aboutsummaryrefslogtreecommitdiffstats
path: root/main/frame.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:54:47 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:54:47 +0000
commit84aa522629f32c10b81a082f2ee91adff67c90f1 (patch)
tree3f8307275224caab3a5ba9fae26b4eebf54ab4cf /main/frame.c
parentb1028d3f65e208e36f7426b7f9b1f98d2c22b889 (diff)
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
Diffstat (limited to 'main/frame.c')
-rw-r--r--main/frame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/frame.c b/main/frame.c
index 940ff5c5c..f2ceabf16 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -992,16 +992,16 @@ int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size)
slen = strlen(formatname);
if (slen > total_len)
break;
- strncat(buf,formatname,total_len);
+ strncat(buf, formatname, total_len - 1); /* safe */
total_len -= slen;
}
if (total_len && x < 31 && ast_codec_pref_index(pref , x + 1)) {
- strncat(buf,"|",total_len);
+ strncat(buf, "|", total_len - 1); /* safe */
total_len--;
}
}
if (total_len) {
- strncat(buf,")",total_len);
+ strncat(buf, ")", total_len - 1); /* safe */
total_len--;
}