diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-03-02 01:13:29 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-03-06 16:10:23 +0100 |
commit | a958c1e2effd97d8f17779ab975d72ee67b1ab09 (patch) | |
tree | a41b05fc4558adfc8f1325dff9bc75a66230447a /fitz | |
parent | 19fdc5eff56166999bfd7342d76358220dd52ca4 (diff) | |
download | mupdf-a958c1e2effd97d8f17779ab975d72ee67b1ab09.tar.xz |
Tweak compression bomb detection.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/stm_read.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fitz/stm_read.c b/fitz/stm_read.c index c2d375f3..a95c62c0 100644 --- a/fitz/stm_read.c +++ b/fitz/stm_read.c @@ -1,5 +1,7 @@ #include "fitz.h" +#define MIN_BOMB (100 << 20) + int fz_read(fz_stream *stm, unsigned char *buf, int len) { @@ -108,7 +110,7 @@ fz_read_all(fz_stream *stm, int initial) if (buf->len == buf->cap) fz_grow_buffer(ctx, buf); - if (buf->len / 200 > initial) + if (buf->len >= MIN_BOMB && buf->len / 200 > initial) { fz_throw(ctx, "compression bomb detected"); } |