Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Decoder completion checks incorrectly reject valid bodyless HEAD responses advertising deflate, gzip, or x-gzip, causing curl -I --compressed to fail with error 61.
1 open issue
What changed in this PR
This PR tightens libcurl’s gzip and deflate decoding to reject incomplete compressed streams, addressing the zlib-related cases in #23615.
Changes:
- Track whether decompression reaches
Z_STREAM_END. - Add end-of-stream flush checks that return
CURLE_BAD_CONTENT_ENCODINGfor incomplete streams.
| File | Description |
|---|---|
lib/content_encoding.c |
Track zlib stream completion and validate it when gzip and deflate decoders finish. |
Review effort: Balanced
…rver responding with 'Content-Encoding: deflate' and empty body)
|
Revised the code, now it maintains a |
There was a problem hiding this comment.
🟡 Changes recommended
Regression tests are still needed for truncated gzip and deflate payloads with matching Content-Length to verify error 61 without HTTP length errors masking failures, and for encoded bodyless HEAD responses to protect the SSTATE_INIT exemption.
1 open issue
1 resolved since last review
Review effort: Balanced
…alid/incomplete deflate content failing), 4274 (HEAD response with Content-Encoding: gzip and Content-Lenght: 0 succeeding)

Disallow incomplete zlib streams for deflate and gzip content encoding.
Fixes deflate and gzip issue reported in #23615