Merged revisions 108469 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Thu, 13 Mar 2008 20:26:59 +0000 (20:26 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 13 Mar 2008 20:26:59 +0000 (20:26 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r108469 | russell | 2008-03-13 15:26:28 -0500 (Thu, 13 Mar 2008) | 4 lines

Fix a couple uses of sprintf.  The second one could actually cause an overflow
of a stack buffer.  It's not a security issue though, it only depends on your
configuration.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_followme.c

index 4e83c81..eeb9f03 100644 (file)
@@ -779,9 +779,9 @@ static void findmeexec(struct fm_args *tpargs)
                        }
 
                        if (!strcmp(tpargs->context, ""))
-                               sprintf(dialarg, "%s", number);
+                               snprintf(dialarg, sizeof(dialarg), "%s", number);
                        else
-                               sprintf(dialarg, "%s@%s", number, tpargs->context);
+                               snprintf(dialarg, sizeof(dialarg), "%s@%s", number, tpargs->context);
 
                        tmpuser = ast_calloc(1, sizeof(*tmpuser));
                        if (!tmpuser) {