diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-07 06:36:33 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-07 06:36:33 +0000 |
commit | 2d66183adf20c8b3898a3bfc97627d55dff7891f (patch) | |
tree | e1d83f46856427c7e9df46336f418ec059a92c57 /main/frame.c | |
parent | 6623be8860eb9337ebbc3a5a32388270fac5628b (diff) |
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/branches/1.4@106552 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/frame.c')
-rw-r--r-- | main/frame.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/frame.c b/main/frame.c index 1dafce9f8..fa54e6772 100644 --- a/main/frame.c +++ b/main/frame.c @@ -1091,16 +1091,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--; } |