summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-05-04 11:06:26 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-05-04 11:11:45 +0200
commitcf02a626d824d09647a3543dd063f083eadfcbf0 (patch)
treee761117d9e770809483288e0a15f6fa05b0aed95
parent082bb41311a832ae1b83bb8fe1dfdefcf4e68ea5 (diff)
downloadcurl-bagder/http-rewind.tar.gz
http: don't set the "rewind" flag when not uploading anythingbagder/http-rewind
It triggers an assert. Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8144
-rw-r--r--lib/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index ec709ff8d..1a313b4fb 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -433,7 +433,7 @@ static CURLcode http_perhapsrewind(struct connectdata *conn)
data left to send, keep on sending. */
/* rewind data when completely done sending! */
- if(!conn->bits.authneg) {
+ if(!conn->bits.authneg && (conn->writesockfd != CURL_SOCKET_BAD)) {
conn->bits.rewindaftersend = TRUE;
infof(data, "Rewind stream after send\n");
}