Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Habersack <grendel@twistedcode.net>2015-09-25 22:18:22 +0300
committerMarek Habersack <grendel@twistedcode.net>2015-09-25 22:18:22 +0300
commitb4d5016b5e42fec226d93fd13260b6cac80eb384 (patch)
tree33ea9a2326b3b3f99119568fad03013d10ab71f2 /support
parent7628e59f4937a2e9be4b2fcb7636e2ee6707b103 (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.c2
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)