From d0fdac59646ea0d6cc61522405dada6113b0fc58 Mon Sep 17 00:00:00 2001 From: Ankit Goel Date: Mon, 19 Aug 2024 19:38:25 +0100 Subject: [PATCH 1/2] Return error instead of packing on Z_MEM_ERROR --- src/ffi/c.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ffi/c.rs b/src/ffi/c.rs index 0c3e4e8e..867f2f9e 100644 --- a/src/ffi/c.rs +++ b/src/ffi/c.rs @@ -263,7 +263,9 @@ impl InflateBackend for Inflate { (*raw).avail_out = 0; match rc { - MZ_DATA_ERROR | MZ_STREAM_ERROR => mem::decompress_failed(self.inner.msg()), + MZ_DATA_ERROR | MZ_STREAM_ERROR | MZ_MEM_ERROR => { + mem::decompress_failed(self.inner.msg()) + } MZ_OK => Ok(Status::Ok), MZ_BUF_ERROR => Ok(Status::BufError), MZ_STREAM_END => Ok(Status::StreamEnd), @@ -431,6 +433,7 @@ mod c_backend { pub use libz::Z_DEFLATED as MZ_DEFLATED; pub use libz::Z_FINISH as MZ_FINISH; pub use libz::Z_FULL_FLUSH as MZ_FULL_FLUSH; + pub use libz::Z_MEM_ERROR as MZ_MEM_ERROR; pub use libz::Z_NEED_DICT as MZ_NEED_DICT; pub use libz::Z_NO_FLUSH as MZ_NO_FLUSH; pub use libz::Z_OK as MZ_OK; From 6084e47797d58616f1c7adf818a048e8b0f015ad Mon Sep 17 00:00:00 2001 From: Ankit Goel Date: Tue, 20 Aug 2024 06:34:11 +0100 Subject: [PATCH 2/2] Bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 64a9ffff..69d4e2de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "flate2" authors = ["Alex Crichton ", "Josh Triplett "] -version = "1.0.31" +version = "1.0.32" edition = "2018" license = "MIT OR Apache-2.0" readme = "README.md"