Skip to content

Commit 01e3f9a

Browse files
committed
fix out of bounds write
1 parent 0306b20 commit 01e3f9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zlib-rs/src/inflate/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'a> Writer<'a> {
108108
) {
109109
let len = range.end - range.start;
110110

111-
if self.remaining() >= core::mem::size_of::<C>() {
111+
if self.remaining() >= len + core::mem::size_of::<C>() {
112112
// Safety: we know that our window has at least a core::mem::size_of::<C>() extra bytes
113113
// at the end, making it always safe to perform an (unaligned) Chunk read anywhere in
114114
// the window slice.

0 commit comments

Comments
 (0)