Safely use the strncat() function.

(closes issue #11958)
 Reported by: norman
 Patches: 
       20080209__bug11958.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-03-07 06:36:33 +00:00
parent 24ca0899c2
commit 56e908b787
10 changed files with 23 additions and 27 deletions

View File

@@ -98,7 +98,7 @@ static int function_enum(struct ast_channel *chan, char *cmd, char *data,
for (s = p = args.number; *s; s++) {
if (*s != '-') {
snprintf(tmp, sizeof(tmp), "%c", *s);
strncat(num, tmp, sizeof(num));
strncat(num, tmp, sizeof(num) - strlen(num) - 1);
}
}