projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7628e59
)
[support] Limit possible values
author
Marek Habersack
<grendel@twistedcode.net>
Fri, 25 Sep 2015 19:18:22 +0000
(21:18 +0200)
committer
Marek Habersack
<grendel@twistedcode.net>
Fri, 25 Sep 2015 19:18:22 +0000
(21:18 +0200)
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.
support/zlib-helper.c
patch
|
blob
|
history
diff --git
a/support/zlib-helper.c
b/support/zlib-helper.c
index 38696260a092fb4b509f7eabc7f9fef96032b2b8..dbfd1c7e24a27e7dd67283e6c1df7401b17d6100 100644
(file)
--- 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)