diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-15 18:50:49 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-15 18:50:49 +0000 |
commit | 8c2439db4de2ccdc52094e0374d59102d9d74c09 (patch) | |
tree | bebbee405fc74b5b46e109a7dea44fdffac39f84 /channels | |
parent | 7c90965ee0c97260ce12dc77dafccc7260cb5d67 (diff) |
Make sure strncat is > 0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1341 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index fd5971e0f..e1727dea9 100755 --- 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; |