Skip to content

Commit 427733c

Browse files
committed
FIX: maximum uncompressed size for GZIP decompression was not large enough
fixes: #18
1 parent 338a0f2 commit 427733c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/u-compress.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void Trap_ZStream_Error(z_stream *stream, int err, REBOOL while_compression)
181181
// Get the uncompressed size from last 4 source data bytes.
182182
if (len < 4) Trap0(RE_PAST_END); // !!! better msg needed
183183
size = cast(REBU64, Bytes_To_REBCNT(BIN_SKIP(input, len) - sizeof(REBCNT)));
184-
if (size > len * 6) Trap_Num(RE_SIZE_LIMIT, size);
184+
if (size > len * 10) Trap_Num(RE_SIZE_LIMIT, size); // check for a realistic limit
185185
}
186186

187187
output = Make_Binary(size);

0 commit comments

Comments
 (0)