summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2021-04-27 15:48:01 -0700
committerDaniel Stenberg <daniel@haxx.se>2021-04-29 15:02:32 +0200
commit5c932f8fe9dad94a7417702958ffa9e8db67c549 (patch)
treebe8e86d19e8d19571ec04a351578131f4836a2c5 /lib/transfer.c
parentf4b85d24b21058215dd67e1c804d47c7b4ee2fda (diff)
downloadcurl-5c932f8fe9dad94a7417702958ffa9e8db67c549.tar.gz
lib: fix 0-length Curl_client_write calls
Closes #6954
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 56ad5e612..c31e22e00 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -830,7 +830,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
Make sure that ALL_CONTENT_ENCODINGS contains all the
encodings handled here. */
if(data->set.http_ce_skip || !k->writer_stack) {
- if(!k->ignorebody) {
+ if(!k->ignorebody && nread) {
#ifndef CURL_DISABLE_POP3
if(conn->handler->protocol & PROTO_FAMILY_POP3)
result = Curl_pop3_write(data, k->str, nread);
@@ -840,7 +840,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
nread);
}
}
- else if(!k->ignorebody)
+ else if(!k->ignorebody && nread)
result = Curl_unencode_write(data, k->writer_stack, k->str, nread);
}
k->badheader = HEADER_NORMAL; /* taken care of now */