mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
lib510: don't write past the end of the buffer if it's too small
This commit is contained in:
parent
646dc1c42a
commit
b1fa80b84f
@ -48,6 +48,10 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
|
|||||||
|
|
||||||
if(data) {
|
if(data) {
|
||||||
size_t len = strlen(data);
|
size_t len = strlen(data);
|
||||||
|
if(size*nmemb < len) {
|
||||||
|
fprintf(stderr, "read buffer is too small to run test\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
memcpy(ptr, data, len);
|
memcpy(ptr, data, len);
|
||||||
pooh->counter++; /* advance pointer */
|
pooh->counter++; /* advance pointer */
|
||||||
return len;
|
return len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user