aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-10 14:50:00 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-10 14:50:00 +0000
commit50cc15b160de2fb4c3abb447574cc5cc0992aed8 (patch)
tree51423560fad112c962662382c7852d0f060ab585 /main/app.c
parentd19f35ad0a01907a33c80941261ca3d2e73808e2 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@74265 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index dbcdcac64..da88a42b3 100644
--- a/main/app.c
+++ b/main/app.c
@@ -843,7 +843,7 @@ int ast_app_group_get_count(const char *group, const char *category)
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);
@@ -866,7 +866,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category)
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);