speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] Don't add multiple copies of a message to the paused list.


From: Christopher Brannon
Subject: [PATCH 2/2] Don't add multiple copies of a message to the paused list.
Date: Wed, 27 Aug 2014 22:53:49 -0700

Fixes another use-after-free in src/server/speaking.c.
---
 src/server/speaking.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/server/speaking.c b/src/server/speaking.c
index b385473..bd27008 100644
--- a/src/server/speaking.c
+++ b/src/server/speaking.c
@@ -558,8 +558,9 @@ int speaking_pause(int fd, int uid)
                    "Including current message into the message paused list");
                current_message->settings.paused = 2;
                current_message->settings.paused_while_speaking = 1;
-               MessagePausedList =
-                   g_list_append(MessagePausedList, current_message);
+               if (g_list_find(MessagePausedList, current_message) == NULL)
+                       MessagePausedList =
+                           g_list_append(MessagePausedList, current_message);
        }
 
        return 0;
-- 
1.8.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]