diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-10-13 00:13:41 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-10-13 07:55:10 +0200 |
commit | 5f9e2ca09b57d82baf239039835b3b06dc41bbc5 (patch) | |
tree | 4799190a2fbf9311aec559da01c6d0ed0d30a96b /lib/mime.c | |
parent | 0401734dfd39617a42318295a6e54064b40b2502 (diff) | |
download | curl-5f9e2ca09b57d82baf239039835b3b06dc41bbc5.tar.gz |
mime: fix the content reader to handle >16K data properly
Reported-by: Jeroen Ooms
Closes #1988
Diffstat (limited to 'lib/mime.c')
-rw-r--r-- | lib/mime.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/mime.c b/lib/mime.c index 1868336ca..c337a35c9 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -620,14 +620,13 @@ static size_t mime_mem_read(char *buffer, size_t size, size_t nitems, { curl_mimepart *part = (curl_mimepart *) instream; size_t sz = (size_t) part->datasize - part->state.offset; - (void) size; /* Always 1.*/ if(sz > nitems) sz = nitems; if(sz) - memcpy(buffer, (char *) part->data, sz); + memcpy(buffer, (char *) &part->data[part->state.offset], sz); part->state.offset += sz; return sz; |