From 84aa522629f32c10b81a082f2ee91adff67c90f1 Mon Sep 17 00:00:00 2001 From: tilghman Date: Fri, 7 Mar 2008 06:54:47 +0000 Subject: Merged revisions 106552 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines Safely use the strncat() function. (closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106553 f38db490-d61c-443f-a65b-d21fe96a405b --- funcs/func_enum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'funcs/func_enum.c') diff --git a/funcs/func_enum.c b/funcs/func_enum.c index d69881955..a60b748a7 100644 --- a/funcs/func_enum.c +++ b/funcs/func_enum.c @@ -93,7 +93,7 @@ static int function_enum(struct ast_channel *chan, const 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); } } -- cgit v1.2.3