[asterisk-commits] mjordan: branch 13 r434449 - in /branches/13: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 8 21:05:06 CDT 2015


Author: mjordan
Date: Wed Apr  8 21:05:04 2015
New Revision: 434449

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434449
Log:
apps/app_queue: Prevent possible crash when evaluating queue penalty rules

Although it only occurred once, a crash occurred when a queue attempted to
evaluate a queue penalty rule that appeared to have already been destroyed.
In many locations in app_queue, a test is done to see if qe->pr is NULL;
however, when we dispose of a queue's penalty rules, we don't set the pointer
to NULL after free'ing it. This patch does that to prevent any dangling
pointers from lingering on the queue object.

Review: https://reviewboard.asterisk.org/r/4522

ASTERISK-23319 #close
Reported by: Vadim
patches:
  rb4552.patch submitted by Stefan Engström (License 6691)
........

Merged revisions 434448 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/13/   (props changed)
    branches/13/apps/app_queue.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/13/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/apps/app_queue.c?view=diff&rev=434449&r1=434448&r2=434449
==============================================================================
--- branches/13/apps/app_queue.c (original)
+++ branches/13/apps/app_queue.c Wed Apr  8 21:05:04 2015
@@ -3900,6 +3900,7 @@
 			while ((pr_iter = AST_LIST_REMOVE_HEAD(&qe->qe_rules, list))) {
 				ast_free(pr_iter);
 			}
+			qe->pr = NULL;
 			snprintf(posstr, sizeof(posstr), "%d", qe->pos);
 			pbx_builtin_setvar_helper(qe->chan, "QUEUEPOSITION", posstr);
 		} else {




More information about the asterisk-commits mailing list