Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changes-entries/deflate-xlen-unsigned.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*) mod_deflate: Read the gzip extra-field (FEXTRA) length as unsigned so a
length byte with the high bit set is no longer sign-extended, fixing
inflation of gzip streams that carry an extra field.
[arshiya tabasum <arshi bugqore.com>]
4 changes: 2 additions & 2 deletions modules/filters/mod_deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ static apr_status_t consume_zlib_flags(deflate_ctx *ctx,
if (!*len) {
return APR_INCOMPLETE;
}
ctx->consume_len = (unsigned int)**data;
ctx->consume_len = (unsigned int)(unsigned char)**data;
ctx->consume_pos++;
++*data;
--*len;
Expand All @@ -1062,7 +1062,7 @@ static apr_status_t consume_zlib_flags(deflate_ctx *ctx,
if (!*len) {
return APR_INCOMPLETE;
}
ctx->consume_len += ((unsigned int)**data) << 8;
ctx->consume_len += ((unsigned int)(unsigned char)**data) << 8;
ctx->consume_pos++;
++*data;
--*len;
Expand Down
Loading