lib547, 555: fix off-by-one null-terminator in read callback

`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082
This commit is contained in:
Viktor Szakats 2025-12-23 12:03:10 +01:00
parent 7e064d0756
commit 66aec526fc
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ static size_t t547_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp)
if(size * nmemb >= T547_DATALEN) {
curl_mfprintf(stderr, "READ!\n");
strcpy(ptr, t547_uploadthis);
memcpy(ptr, t547_uploadthis, T547_DATALEN);
return T547_DATALEN;
}
curl_mfprintf(stderr, "READ NOT FINE!\n");

View File

@ -48,7 +48,7 @@ static size_t t555_read_cb(char *ptr, size_t size, size_t nmemb, void *clientp)
if(size * nmemb >= T555_DATALEN) {
curl_mfprintf(stderr, "READ!\n");
strcpy(ptr, t555_uploadthis);
memcpy(ptr, t555_uploadthis, T555_DATALEN);
return T555_DATALEN;
}
curl_mfprintf(stderr, "READ NOT FINE!\n");