Replace strcpy with memmove for overlapping regions

This commit is contained in:
Vladimir Dubrovin committed 2024-12-20 14:38:58 +03:00
1 parent cb6a4166b7
commit 6387bed4f2
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -121,7 +121,7 @@ int ftpsyst(struct clientparam *param, unsigned char *buf, unsigned len){
buf[3] = 0;
if(atoi((char *)buf)/100 != 2) return 723;
buf[i-2] = 0;
strcpy((char *)buf, (char *)buf+4);
memmove((char *)buf, (char *)buf+4, strlen((char *)buf+4)+1);
return 0;
}
@@ -145,7 +145,7 @@ int ftppwd(struct clientparam *param, unsigned char *buf, unsigned len){
b++;
*e = 0;
}
strcpy((char *)buf, b);
memmove((char *)buf, b, strlen(b)+1);
return 0;
}