From 0d022d305748d05763e950a6fba9b8c1450b6143 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 2 Dec 2009 15:26:56 -0600 Subject: [PATCH] Fix: Don't allow cancelation of command id 0 --- gatchat/gatchat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 04995ccc..1dffd89a 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -1192,6 +1192,10 @@ gboolean g_at_chat_cancel(GAtChat *chat, guint id) if (chat == NULL || chat->command_queue == NULL) return FALSE; + /* We use id 0 for wakeup commands */ + if (id == 0) + return FALSE; + l = g_queue_find_custom(chat->command_queue, GUINT_TO_POINTER(id), at_command_compare_by_id);