summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-03-07 06:54:47 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-03-07 06:54:47 +0000
commit8718878490016dbc64c36bc25e695672debf79d3 (patch)
tree3f8307275224caab3a5ba9fae26b4eebf54ab4cf /channels/chan_sip.c
parent5fa773a9f95727e11fc3f175fa456fdcfe3564bf (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: https://origsvn.digium.com/svn/asterisk/trunk@106553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fa9052dfa..40645214a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2208,7 +2208,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_serve
ast_mutex_unlock(req.socket.lock);
if (me->stop)
goto cleanup;
- strncat(req.data, buf, sizeof(req.data) - req.len);
+ strncat(req.data, buf, sizeof(req.data) - req.len - 1);
req.len = strlen(req.data);
}
parse_copy(&reqcpy, &req);
@@ -2223,7 +2223,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_serve
if (me->stop)
goto cleanup;
cl -= strlen(buf);
- strncat(req.data, buf, sizeof(req.data) - req.len);
+ strncat(req.data, buf, sizeof(req.data) - req.len - 1);
req.len = strlen(req.data);
}
}