projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6aa3efe
)
Make sure strncat is > 0
author
Mark Spencer
<markster@digium.com>
Fri, 15 Aug 2003 18:50:49 +0000
(18:50 +0000)
committer
Mark Spencer
<markster@digium.com>
Fri, 15 Aug 2003 18:50:49 +0000
(18:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1341
65c4cc65
-6c06-0410-ace0-
fbb531ad65f3
channels/chan_sip.c
patch
|
blob
|
history
diff --git
a/channels/chan_sip.c
b/channels/chan_sip.c
index
fd5971e
..
e1727de
100755
(executable)
--- a/
channels/chan_sip.c
+++ b/
channels/chan_sip.c
@@
-3720,9
+3720,13
@@
static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, cha
static int get_msg_text(char *buf, int len, struct sip_request *req)
{
int x;
+ int y;
strcpy(buf, "");
+ y = len - strlen(buf) - 5;
+ if (y < 0)
+ y = 0;
for (x=0;x<req->lines;x++) {
- strncat(buf, req->line[x], len - strlen(buf) - 5);
+ strncat(buf, req->line[x], y);
strcat(buf, "\n");
}
return 0;