Check return value before dereferencing (Bug 8822)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@50987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-01-15 23:09:02 +00:00
parent 741131aaa2
commit e9b6a2c807

View File

@@ -70,7 +70,8 @@ static int group_count_exec(struct ast_channel *chan, void *data)
if (ast_strlen_zero(group)) {
grp = pbx_builtin_getvar_helper(chan, category);
strncpy(group, grp, sizeof(group) - 1);
if (!ast_strlen_zero(grp))
ast_copy_string(group, grp, sizeof(group));
}
count = ast_app_group_get_count(group, category);