]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
apps/app_meetme: Fix crash when publishing MeetMe messages with no channel
authorMatthew Jordan <mjordan@digium.com>
Sun, 17 Aug 2014 23:28:27 +0000 (23:28 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 17 Aug 2014 23:28:27 +0000 (23:28 +0000)
The same function, meetme_stasis_generate_msg, handles creating and publishing
Stasis message both when there are channels in the MeetMe conference and when
there are no channels in the conference. When the performance improvement was
made to use cached snapshots, this created a situation where Asterisk would
crash: obtaining a cached snapshot is not NULL tolerant.

This patch restores the previous implementation, which used a NULL safe set
of routines to produce a blob containing the channel snapshot (if available)
and information about the MeetMe conference.

ASTERISK-24234 #close
Reported by: Shaun Ruffell
Tested by: Shaun Ruffell

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@421270 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index a2d7ef89da717b671e33b4ea6c03b15ce2865b30..774b52e30f096e5e4666d6a659a1df9a1349ec44 100644 (file)
@@ -1379,7 +1379,13 @@ static void meetme_stasis_generate_msg(struct ast_conference *meetme_conference,
                }
        }
 
-       msg = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), message_type, json_object);
+       if (chan) {
+               ast_channel_lock(chan);
+       }
+       msg = ast_channel_blob_create(chan, message_type, json_object);
+       if (chan) {
+               ast_channel_unlock(chan);
+       }
 
        if (!msg) {
                return;