From 95698093f023852ca4365df307c19a1d7cfa3687 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 5 Jul 2015 18:14:53 -0700 Subject: Improve speed of gzprintf() in transparent mode. --- gzlib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gzlib.c') diff --git a/gzlib.c b/gzlib.c index ced2cb8..3e344f9 100644 --- a/gzlib.c +++ b/gzlib.c @@ -331,6 +331,8 @@ int ZEXPORT gzbuffer(file, size) return -1; /* check and set requested size */ + if ((size << 1) < size) + return -1; /* need to be able to double it */ if (size < 2) size = 2; /* need two bytes to check magic header */ state->want = size; -- cgit v1.2.1