chore: Bug fix: crypto_header was being counted toward extra_data_end
This commit is contained in:
parent
7f641d23a3
commit
9e12b6db0c
1 changed files with 1 additions and 1 deletions
|
@ -280,6 +280,7 @@ pub struct ExtendedFileOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ExtendedFileOptions {
|
impl ExtendedFileOptions {
|
||||||
|
/// Adds an extra data field, unless we detect that it's invalid.
|
||||||
pub fn add_extra_data(
|
pub fn add_extra_data(
|
||||||
&mut self,
|
&mut self,
|
||||||
header_id: u16,
|
header_id: u16,
|
||||||
|
@ -986,7 +987,6 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
let crypto_header = [0u8; 12];
|
let crypto_header = [0u8; 12];
|
||||||
|
|
||||||
zipwriter.write_all(&crypto_header)?;
|
zipwriter.write_all(&crypto_header)?;
|
||||||
extra_data_end = zipwriter.writer.stream_position()?;
|
|
||||||
self.inner = Storer(MaybeEncrypted::ZipCrypto(zipwriter));
|
self.inner = Storer(MaybeEncrypted::ZipCrypto(zipwriter));
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue