diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2023-08-14 17:01:54 -0700 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2023-08-14 17:01:54 -0700 |
| commit | d98251478246c8ef2f405d76e4ef1678c14d7eda (patch) | |
| tree | 28f3e5f3329cec6b29ad43997539a949d07db683 | |
| parent | 6951bc609b5f70d07b752e33c340da334a30df3a (diff) | |
| download | zlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.tar.gz zlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.tar.bz2 zlib-d98251478246c8ef2f405d76e4ef1678c14d7eda.zip | |
Fix bug when using gzflush() with a very small buffer.
| -rw-r--r-- | gzlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -308,8 +308,8 @@ int ZEXPORT gzbuffer(gzFile file, unsigned size) { | |||
| 308 | /* check and set requested size */ | 308 | /* check and set requested size */ |
| 309 | if ((size << 1) < size) | 309 | if ((size << 1) < size) |
| 310 | return -1; /* need to be able to double it */ | 310 | return -1; /* need to be able to double it */ |
| 311 | if (size < 2) | 311 | if (size < 8) |
| 312 | size = 2; /* need two bytes to check magic header */ | 312 | size = 8; /* needed to behave well with flushing */ |
| 313 | state->want = size; | 313 | state->want = size; |
| 314 | return 0; | 314 | return 0; |
| 315 | } | 315 | } |
