summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
Diffstat (limited to 'fitz')
-rw-r--r--fitz/stm_read.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index 28a92f22..94b6d709 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -70,6 +70,9 @@ fz_readall(fz_buffer **bufp, fz_stream *stm, int initial)
if (buf->len == buf->cap)
fz_growbuffer(buf);
+ if (buf->len > initial * 100)
+ return fz_throw("compression bomb detected");
+
n = fz_read(stm, buf->data + buf->len, buf->cap - buf->len);
if (n < 0)
{