mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
MFV: zlib: Fix buffer overflow bug in non-blocking gzwrite.
MFC after: 3 days DIfferential revision: https://reviews.freebsd.org/D60695
This commit is contained in:
commit
7fe1d8abad
1 file changed
+4
-1
@@ -243,8 +243,11 @@ local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
|
||||
n -= state->strm.avail_in;
|
||||
state->x.pos += n;
|
||||
len -= n;
|
||||
if (ret == -1)
|
||||
if (ret == -1) {
|
||||
state->strm.avail_in = 0;
|
||||
state->strm.next_in = state->in;
|
||||
return state->again ? put - len : 0;
|
||||
}
|
||||
} while (len);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user