diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-08-17 23:29:34 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-08-17 23:29:34 +0000 |
commit | 6525f374dbc2198070accbca1a4594d18cc71f9c (patch) | |
tree | 415b65a560402c849f522ac4585a8042f2b63ead /apps/app_meetme.c | |
parent | 44fc6ea6ff2d6fe5d7781a1ad45d096b62d7d2b8 (diff) |
apps/app_meetme: Fix crash when publishing MeetMe messages with no channel
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
........
Merged revisions 421270 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 421273 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_meetme.c')
-rw-r--r-- | apps/app_meetme.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 824dab547..bb87381fd 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1380,7 +1380,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; |