1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

lib510: don't write past the end of the buffer if it's too small

This commit is contained in:
Dan Fandrich 2017-05-13 22:57:49 +02:00
parent 646dc1c42a
commit b1fa80b84f

View File

@ -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;