From: Joshua Colp Date: Tue, 10 Jul 2007 14:51:09 +0000 (+0000) Subject: Merged revisions 74265 via svnmerge from X-Git-Tag: 1.6.0-beta1~3^2~2105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14580951919ebb0aad1a4fb257657870260c6042;p=thirdparty%2Fasterisk.git Merged revisions 74265 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r74265 | file | 2007-07-10 11:50:00 -0300 (Tue, 10 Jul 2007) | 10 lines Merged revisions 74264 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74264 | file | 2007-07-10 11:48:00 -0300 (Tue, 10 Jul 2007) | 2 lines Ensure the group information category exists before trying to do a string comparison with it. (issue #10171 reported by mlegas) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74266 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/app.c b/main/app.c index 53c0d1f0fa..52536abc53 100644 --- a/main/app.c +++ b/main/app.c @@ -908,7 +908,7 @@ int ast_app_group_get_count(const char *group, const char *category) AST_RWLIST_RDLOCK(&groups); AST_RWLIST_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_RWLIST_UNLOCK(&groups); @@ -931,7 +931,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category) AST_RWLIST_RDLOCK(&groups); AST_RWLIST_TRAVERSE(&groups, gi, list) { - if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category))) + if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) count++; } AST_RWLIST_UNLOCK(&groups);