mirror of
https://github.com/curl/curl.git
synced 2026-07-29 03:33:10 +03:00
content_encoding: give a clear error on multi-member gzip
A gzip Content-Encoding response holding more than one gzip member made curl decode the first member and then fail the transfer with a bare CURLE_WRITE_ERROR and no hint about the cause. Detect the trailing member and fail with a message that explains what happened. Fixes #22156 Closes #22172
This commit is contained in:
parent
2b5911880b
commit
df350dd0d8
3 changed files with 70 additions and 1 deletions
|
|
@ -206,6 +206,14 @@ static CURLcode inflate_stream(struct Curl_easy *data,
|
|||
/* No more data to flush: exit loop. */
|
||||
break;
|
||||
case Z_STREAM_END:
|
||||
if((started == ZLIB_INIT_GZIP) && (z->avail_in >= 2) &&
|
||||
(z->next_in[0] == 0x1f) && (z->next_in[1] == 0x8b)) {
|
||||
/* a second gzip member follows; curl does not support
|
||||
multi-member gzip responses */
|
||||
failf(data, "Multi-member gzip response not supported");
|
||||
result = exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
|
||||
break;
|
||||
}
|
||||
result = process_trailer(data, zp);
|
||||
break;
|
||||
case Z_DATA_ERROR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue