mirror of git://git.sysmocom.de/ofono
Fix a crash with unsolicited notifications
When a line comes in from the modem, we check against prefixes in outstanding commands and unsolicited notifications. If the outstanding command has not yet been sent (cmd_bytes_written == 0), we still check it resulting in access violation.
This commit is contained in:
parent
b638b315f9
commit
d4536b3d2b
|
@ -466,7 +466,7 @@ static void have_line(GAtChat *p, gboolean strip_preceding)
|
|||
|
||||
cmd = g_queue_peek_head(p->command_queue);
|
||||
|
||||
if (cmd) {
|
||||
if (cmd && p->cmd_bytes_written > 0) {
|
||||
char c = cmd->cmd[p->cmd_bytes_written - 1];
|
||||
|
||||
/* We check that we have submitted a terminator, in which case
|
||||
|
|
Loading…
Reference in New Issue