[asterisk-commits] file: branch 1.2 r74264 - /branches/1.2/app.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 10 09:48:01 CDT 2007


Author: file
Date: Tue Jul 10 09:48:00 2007
New Revision: 74264

URL: http://svn.digium.com/view/asterisk?view=rev&rev=74264
Log:
Ensure the group information category exists before trying to do a string comparison with it. (issue #10171 reported by mlegas)

Modified:
    branches/1.2/app.c

Modified: branches/1.2/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/app.c?view=diff&rev=74264&r1=74263&r2=74264
==============================================================================
--- branches/1.2/app.c (original)
+++ branches/1.2/app.c Tue Jul 10 09:48:00 2007
@@ -1084,7 +1084,7 @@
 
 	AST_LIST_LOCK(&groups);
 	AST_LIST_TRAVERSE(&groups, gi, list) {
-		if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+		if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
 			count++;
 	}
 	AST_LIST_UNLOCK(&groups);
@@ -1107,7 +1107,7 @@
 
 	AST_LIST_LOCK(&groups);
 	AST_LIST_TRAVERSE(&groups, gi, list) {
-		if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+		if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
 			count++;
 	}
 	AST_LIST_UNLOCK(&groups);




More information about the asterisk-commits mailing list