From 5d9296244cd235a430e9878c89b4e94d5020981b Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Sat, 29 Apr 2023 18:03:11 -0700 Subject: [PATCH] Add debug_assert! that file end isn't before start --- src/write.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/write.rs b/src/write.rs index 35374aa6..d0f5165a 100644 --- a/src/write.rs +++ b/src/write.rs @@ -471,6 +471,7 @@ impl ZipWriter { file.uncompressed_size = self.stats.bytes_written; let file_end = writer.stream_position()?; + debug_assert!(file_end >= self.stats.start); file.compressed_size = file_end - self.stats.start; update_local_file_header(writer, file)?;