diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-10 14:48:00 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-10 14:48:00 +0000 |
commit | 9001d40c81c2c7c37413dab3e33a4bf6cfe4c48e (patch) | |
tree | 64260ecbb427c38ab497b594ffacb3a215d57256 | |
parent | 8c9d9049a12f83a68541501d937c0db6fbedda92 (diff) |
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.2@74264 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | app.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1084,7 +1084,7 @@ int ast_app_group_get_count(char *group, 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); @@ -1107,7 +1107,7 @@ int ast_app_group_match_get_count(char *groupmatch, char *category) AST_LIST_LOCK(&groups); AST_LIST_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_LIST_UNLOCK(&groups); |