From 5c932f8fe9dad94a7417702958ffa9e8db67c549 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Tue, 27 Apr 2021 15:48:01 -0700 Subject: lib: fix 0-length Curl_client_write calls Closes #6954 --- lib/transfer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/transfer.c') 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 */ -- cgit v1.2.1