artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df03c47
)
Fix bug when using gzflush() with a very small buffer.
author
tb
<tb@openbsd.org>
Tue, 15 Aug 2023 12:18:46 +0000
(12:18 +0000)
committer
tb
<tb@openbsd.org>
Tue, 15 Aug 2023 12:18:46 +0000
(12:18 +0000)
from upstream
lib/libz/gzlib.c
patch
|
blob
|
history
diff --git
a/lib/libz/gzlib.c
b/lib/libz/gzlib.c
index
2b446c4
..
29fc448
100644
(file)
--- a/
lib/libz/gzlib.c
+++ b/
lib/libz/gzlib.c
@@
-308,8
+308,8
@@
int ZEXPORT gzbuffer(gzFile file, unsigned size) {
/* 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
*/
+ if (size <
8
)
+ size =
8; /* needed to behave well with flushing
*/
state->want = size;
return 0;
}