From 9e12b6db0cb7958fb5abc4169101ff5757ee073c Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:41:47 -0700 Subject: [PATCH] chore: Bug fix: crypto_header was being counted toward extra_data_end --- src/write.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write.rs b/src/write.rs index 0e615d131..1e6cf5733 100644 --- a/src/write.rs +++ b/src/write.rs @@ -280,6 +280,7 @@ pub struct ExtendedFileOptions { } impl ExtendedFileOptions { + /// Adds an extra data field, unless we detect that it's invalid. pub fn add_extra_data( &mut self, header_id: u16, @@ -986,7 +987,6 @@ impl ZipWriter { let crypto_header = [0u8; 12]; zipwriter.write_all(&crypto_header)?; - extra_data_end = zipwriter.writer.stream_position()?; self.inner = Storer(MaybeEncrypted::ZipCrypto(zipwriter)); } None => {}