1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 03:55:03 -05:00

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
This commit is contained in:
Daniel Stenberg 2018-05-04 11:06:26 +02:00
parent 277d3cdc0f
commit e9d9d1af8a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -433,7 +433,7 @@ static CURLcode http_perhapsrewind(struct connectdata *conn)
data left to send, keep on sending. */ data left to send, keep on sending. */
/* rewind data when completely done sending! */ /* rewind data when completely done sending! */
if(!conn->bits.authneg) { if(!conn->bits.authneg && (conn->writesockfd != CURL_SOCKET_BAD)) {
conn->bits.rewindaftersend = TRUE; conn->bits.rewindaftersend = TRUE;
infof(data, "Rewind stream after send\n"); infof(data, "Rewind stream after send\n");
} }