diff options
author | Russell Bryant <russell@russellbryant.com> | 2005-07-27 22:43:18 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2005-07-27 22:43:18 +0000 |
commit | bbb33e5c41237f54e77a1968ad7d0ed06616a422 (patch) | |
tree | 619ca8c9c6b729653cf29e4da6f568445179ba04 /funcs | |
parent | 80af1153bcea49c045c66944677b31d1c90b1afe (diff) |
don't crash if no group is specified (bug #4836)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs')
-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); |