[asterisk-commits] seanbright: branch 10 r362587 - in /branches/10: ./ apps/app_externalivr.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 19 11:04:25 CDT 2012
Author: seanbright
Date: Thu Apr 19 11:04:21 2012
New Revision: 362587
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362587
Log:
Prevent a crash in ExternalIVR when the 'S' command is sent first.
If the first command sent from an ExternalIVR client is an 'S' command, we were
blindly removing the first element from the play list and deferencing it, even
if it was NULL. This corrects that and also locks appropriately in one place.
(issue ASTERISK-17889)
Reported by: Chris Maciejewski
........
Merged revisions 362586 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/10/ (props changed)
branches/10/apps/app_externalivr.c
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/apps/app_externalivr.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_externalivr.c?view=diff&rev=362587&r1=362586&r2=362587
==============================================================================
--- branches/10/apps/app_externalivr.c (original)
+++ branches/10/apps/app_externalivr.c Thu Apr 19 11:04:21 2012
@@ -683,13 +683,14 @@
if (f->frametype == AST_FRAME_DTMF) {
send_eivr_event(eivr_events, f->subclass.integer, NULL, chan);
if (u->option_autoclear) {
+ AST_LIST_LOCK(&u->playlist);
if (!u->abort_current_sound && !u->playing_silence) {
/* send interrupted file as T data */
- entry = AST_LIST_REMOVE_HEAD(&u->playlist, list);
- send_eivr_event(eivr_events, 'T', entry->filename, chan);
- ast_free(entry);
+ if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {
+ send_eivr_event(eivr_events, 'T', entry->filename, chan);
+ ast_free(entry);
+ }
}
- AST_LIST_LOCK(&u->playlist);
while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {
send_eivr_event(eivr_events, 'D', entry->filename, chan);
ast_free(entry);
@@ -768,9 +769,10 @@
AST_LIST_LOCK(&u->playlist);
if (!u->abort_current_sound && !u->playing_silence) {
/* send interrupted file as T data */
- entry = AST_LIST_REMOVE_HEAD(&u->playlist, list);
- send_eivr_event(eivr_events, 'T', entry->filename, chan);
- ast_free(entry);
+ if ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {
+ send_eivr_event(eivr_events, 'T', entry->filename, chan);
+ ast_free(entry);
+ }
}
while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) {
send_eivr_event(eivr_events, 'D', entry->filename, chan);
More information about the asterisk-commits
mailing list