diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-07-21 14:38:29 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-07-21 21:45:01 +0200 |
commit | 5b69740e1c72bd261bc37adc6fbbf09fa50cc5a2 (patch) | |
tree | cfe51aca3542c1752e3ce68000e9e916a923f223 /gatchat | |
parent | 7c73daec2f89ccd829881c608e833e5dc859bbcb (diff) | |
download | connman-5b69740e1c72bd261bc37adc6fbbf09fa50cc5a2.tar.gz connman-5b69740e1c72bd261bc37adc6fbbf09fa50cc5a2.tar.bz2 connman-5b69740e1c72bd261bc37adc6fbbf09fa50cc5a2.zip |
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.
Diffstat (limited to 'gatchat')
-rw-r--r-- | gatchat/gatchat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 616f843a..15cc934c 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -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 |