Skip to content

Commit

Permalink
FIX: maximum uncompressed size for GZIP decompression was not large e…
Browse files Browse the repository at this point in the history
…nough

fixes: #18
  • Loading branch information
Oldes committed Mar 3, 2020
1 parent 338a0f2 commit 427733c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/u-compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void Trap_ZStream_Error(z_stream *stream, int err, REBOOL while_compression)
// Get the uncompressed size from last 4 source data bytes.
if (len < 4) Trap0(RE_PAST_END); // !!! better msg needed
size = cast(REBU64, Bytes_To_REBCNT(BIN_SKIP(input, len) - sizeof(REBCNT)));
if (size > len * 6) Trap_Num(RE_SIZE_LIMIT, size);
if (size > len * 10) Trap_Num(RE_SIZE_LIMIT, size); // check for a realistic limit
}

output = Make_Binary(size);
Expand Down

0 comments on commit 427733c

Please sign in to comment.