diff options
author | Marek Habersack <grendel@twistedcode.net> | 2015-09-25 22:18:22 +0300 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2015-09-25 22:18:22 +0300 |
commit | b4d5016b5e42fec226d93fd13260b6cac80eb384 (patch) | |
tree | 33ea9a2326b3b3f99119568fad03013d10ab71f2 /support | |
parent | 7628e59f4937a2e9be4b2fcb7636e2ee6707b103 (diff) |
[support] Limit possible values
Value returned from the reader function can be negative and ZStream's
avail_in should not be less than 0 as that value makes no sense and
other parts of code assume it to be equal or higher than 0.
Diffstat (limited to 'support')
-rw-r--r-- | support/zlib-helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/zlib-helper.c b/support/zlib-helper.c index 38696260a09..dbfd1c7e24a 100644 --- a/support/zlib-helper.c +++ b/support/zlib-helper.c @@ -187,7 +187,7 @@ ReadZStream (ZStream *stream, guchar *buffer, gint length) stream->eof = TRUE; } zs->next_in = stream->buffer; - zs->avail_in = n; + zs->avail_in = n < 0 ? 0 : n; } if (zs->avail_in == 0 && zs->total_in == 0) |