aboutsummaryrefslogtreecommitdiff
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 13:51:25 +0200
commite9d9d1af8a512d4b4ed500308247766524b21763 (patch)
tree1021fbbda0bb295d808988c5382b57f3ce88a40f
parent277d3cdc0f45606defd275276f9ca4b5cfeeb16b (diff)
http: don't set the "rewind" flag when not uploading anything
It triggers an assert. Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8144 Closes #2546
-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");
}