Fix: Don't allow cancelation of command id 0
authorDenis Kenzior <denkenz@gmail.com>
Wed, 2 Dec 2009 21:26:56 +0000 (15:26 -0600)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Dec 2009 01:16:20 +0000 (02:16 +0100)
gatchat/gatchat.c

index 04995cc..1dffd89 100644 (file)
@@ -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);