Skip to content

Commit

Permalink
chore: Bug fix: crypto_header was being counted toward extra_data_end
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jun 14, 2024
1 parent 7f641d2 commit 9e12b6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -986,7 +987,6 @@ impl<W: Write + Seek> ZipWriter<W> {
let crypto_header = [0u8; 12];

zipwriter.write_all(&crypto_header)?;
extra_data_end = zipwriter.writer.stream_position()?;
self.inner = Storer(MaybeEncrypted::ZipCrypto(zipwriter));
}
None => {}
Expand Down

0 comments on commit 9e12b6d

Please sign in to comment.