[svn-commits] tilghman: trunk r123358 - /trunk/main/pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 17 13:23:02 CDT 2008


Author: tilghman
Date: Tue Jun 17 13:23:01 2008
New Revision: 123358

URL: http://svn.digium.com/view/asterisk?view=rev&rev=123358
Log:
If we don't match registrar when destroying a context, it can cause a crash.
(closes issue #12835)
 Reported by: ys
 Patches: 
       pbx.c.diff uploaded by ys (license 281)

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=123358&r1=123357&r2=123358
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Jun 17 13:23:01 2008
@@ -7153,13 +7153,13 @@
 	struct ast_context *tmp, *tmpl=NULL;
 	struct ast_exten *exten_item, *prio_item;
 
-
 	for (tmp = list; tmp; ) {
 		struct ast_context *next = NULL;	/* next starting point */
 		for (; tmp; tmpl = tmp, tmp = tmp->next) {
 			ast_debug(1, "check ctx %s %s\n", tmp->name, tmp->registrar);
-			if ( registrar || (con && strcasecmp(tmp->name, con->name)) )
+			if ( (registrar && !strcasecmp(tmp->registrar, registrar)) || (con && !strcasecmp(tmp->name, con->name)) ) {
 				break;	/* found it */
+			}
 		}
 		if (!tmp)	/* not found, we are done */
 			break;




More information about the svn-commits mailing list