Skip to content

Commit

Permalink
FIX: enhance max decompression limit for Zlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Mar 28, 2020
1 parent be24830 commit 599e94f
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 * 10) Trap_Num(RE_SIZE_LIMIT, size); // check for a realistic limit
if (size > len * 14) Trap_Num(RE_SIZE_LIMIT, size); // check for a realistic limit
}

output = Make_Binary(size);
Expand Down

0 comments on commit 599e94f

Please sign in to comment.