dect
/
asterisk
Archived
13
0
Fork 0

Make sure strncat is > 0

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1341 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2003-08-15 18:50:49 +00:00
parent 7c90965ee0
commit 8c2439db4d
1 changed files with 5 additions and 1 deletions

View File

@ -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;