projects
/
curl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
646dc1c
)
lib510: don't write past the end of the buffer if it's too small
author
Dan Fandrich
<dan@coneharvesters.com>
Sat, 13 May 2017 20:57:49 +0000
(22:57 +0200)
committer
Dan Fandrich
<dan@coneharvesters.com>
Sat, 13 May 2017 21:13:09 +0000
(23:13 +0200)
tests/libtest/lib510.c
patch
|
blob
|
history
diff --git
a/tests/libtest/lib510.c
b/tests/libtest/lib510.c
index 68588cfe6c6caa56611b6e6d63959a8c696de801..4c290f1ef7c7aaa70d29c8da9679b5e7d3379dd2 100644
(file)
--- a/
tests/libtest/lib510.c
+++ b/
tests/libtest/lib510.c
@@
-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;