piz-rs
piz-rs copied to clipboard
Panic: invalid or out-of-range date
I am using piz v0.3.1 and getting this panics while decompressing some e-mail attachments:
7: core::panicking::panic_fmt::h12ac4570ea43d06f
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92
8: core::option::expect_failed::h7e0f81ae38d4dc42
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/option.rs:1260
9: core::option::Option<T>::expect::ha7330c96ed8c69f4
at /home/kazuya/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:349
10: chrono::naive::date::NaiveDate::from_ymd::h16d7f41a3fe19334
at /home/kazuya/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.19/src/naive/date.rs:173
11: piz::spec::parse_msdos::h16a35babf45852a2
at /home/kazuya/.cargo/registry/src/github.com-1ecc6299db9ec823/piz-0.3.1/src/spec.rs:563
12: piz::spec::<impl piz::read::FileMetadata>::from_cde::h5dc7f91754e590ae
at /home/kazuya/.cargo/registry/src/github.com-1ecc6299db9ec823/piz-0.3.1/src/spec.rs:500
13: piz::read::ZipArchive::with_prepended_data::he128159493610d22
at /home/kazuya/.cargo/registry/src/github.com-1ecc6299db9ec823/piz-0.3.1/src/read.rs:229
14: piz::read::ZipArchive::new::h8410b618494e47bd
at /home/kazuya/.cargo/registry/src/github.com-1ecc6299db9ec823/piz-0.3.1/src/read.rs:115
When I open the ZIP file in LXQt Archiver I get the Modified date set to UNIX Epoch (1/1/70) so I guess this is the default behavior in this case. Note that this attachments are system generated archives containing DMARC reports; I guess normal file archives would not have this sort of issues.