mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
Make sure strncat is > 0
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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)
|
static int get_msg_text(char *buf, int len, struct sip_request *req)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
int y;
|
||||||
strcpy(buf, "");
|
strcpy(buf, "");
|
||||||
|
y = len - strlen(buf) - 5;
|
||||||
|
if (y < 0)
|
||||||
|
y = 0;
|
||||||
for (x=0;x<req->lines;x++) {
|
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");
|
strcat(buf, "\n");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user