diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-27 22:43:18 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-27 22:43:18 +0000 |
commit | cab50baaafb2608852b1b65053e5c45343426c7b (patch) | |
tree | 619ca8c9c6b729653cf29e4da6f568445179ba04 /funcs/func_groupcount.c | |
parent | e273ab76f0c92841effbb975fa1c1dac81bd9344 (diff) |
don't crash if no group is specified (bug #4836)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6237 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_groupcount.c')
-rwxr-xr-x | funcs/func_groupcount.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/funcs/func_groupcount.c b/funcs/func_groupcount.c index 292364a46..66a7367ac 100755 --- a/funcs/func_groupcount.c +++ b/funcs/func_groupcount.c @@ -33,8 +33,10 @@ static char *group_count_function_read(struct ast_channel *chan, char *cmd, char ast_app_group_split_group(data, group, sizeof(group), category, sizeof(category)); if (ast_strlen_zero(group)) { - grp = pbx_builtin_getvar_helper(chan, category); - ast_copy_string(group, grp, sizeof(group)); + if ((grp = pbx_builtin_getvar_helper(chan, category))) + ast_copy_string(group, grp, sizeof(group)); + else + return buf; } count = ast_app_group_get_count(group, category); |