mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-22 18:15:41 +08:00
Replace strcpy with memmove for overlapping regions
This commit is contained in:
parent
cb6a4166b7
commit
6387bed4f2
@ -121,7 +121,7 @@ int ftpsyst(struct clientparam *param, unsigned char *buf, unsigned len){
|
|||||||
buf[3] = 0;
|
buf[3] = 0;
|
||||||
if(atoi((char *)buf)/100 != 2) return 723;
|
if(atoi((char *)buf)/100 != 2) return 723;
|
||||||
buf[i-2] = 0;
|
buf[i-2] = 0;
|
||||||
strcpy((char *)buf, (char *)buf+4);
|
memmove((char *)buf, (char *)buf+4, strlen((char *)buf+4)+1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ int ftppwd(struct clientparam *param, unsigned char *buf, unsigned len){
|
|||||||
b++;
|
b++;
|
||||||
*e = 0;
|
*e = 0;
|
||||||
}
|
}
|
||||||
strcpy((char *)buf, b);
|
memmove((char *)buf, b, strlen(b)+1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ static void logurl(struct clientparam * param, char * buf, char * req, int ftp){
|
|||||||
sb = strchr(buf, '\r');
|
sb = strchr(buf, '\r');
|
||||||
if(sb)*sb = 0;
|
if(sb)*sb = 0;
|
||||||
if(ftp && (se = strchr(buf + 10, ':')) && (sb = strchr(se, '@')) ) {
|
if(ftp && (se = strchr(buf + 10, ':')) && (sb = strchr(se, '@')) ) {
|
||||||
strcpy(se, sb);
|
memmove(se, sb, strlen(sb)+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(param->res != 555 && param->res != 508)dolog(param, (unsigned char *)(req?buf:NULL));
|
if(param->res != 555 && param->res != 508)dolog(param, (unsigned char *)(req?buf:NULL));
|
||||||
|
Loading…
Reference in New Issue
Block a user