]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Check return value before dereferencing (Bug 8822)
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 15 Jan 2007 23:09:02 +0000 (23:09 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 15 Jan 2007 23:09:02 +0000 (23:09 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@50987 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_groupcount.c

index 07c07835c954369675be98afdb14f5788562e2df..e44451370f4997ee0375b12f43a1abc2abc4a284 100644 (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);