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:
Denis Kenzior 2009-07-21 14:38:29 -05:00
parent b638b315f9
commit d4536b3d2b
1 changed files with 1 additions and 1 deletions

View File

@ -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