mirror of
https://github.com/curl/curl.git
synced 2026-04-26 11:52:12 +03: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
1 changed files with 4 additions and 0 deletions
|
|
@ -48,6 +48,10 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
|
|||
|
||||
if(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);
|
||||
pooh->counter++; /* advance pointer */
|
||||
return len;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue