Skip to content

Commit

Permalink
fail reading archive index if unsupported compression algo is found
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jul 12, 2023
1 parent a00f8cc commit 4541146
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/storage/archive_index.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::error::Result;
use crate::storage::{compression::CompressionAlgorithm, FileRange};
use anyhow::Context as _;
use anyhow::{bail, Context as _};
use memmap2::MmapOptions;
use rusqlite::{Connection, OptionalExtension};
use serde::de::DeserializeSeed;
Expand Down Expand Up @@ -92,7 +92,10 @@ impl Index {
zf.data_start(),
zf.data_start() + zf.compressed_size() - 1,
),
compression: CompressionAlgorithm::Bzip2,
compression: match zf.compression() {
zip::CompressionMethod::Bzip2 => CompressionAlgorithm::Bzip2,
c => bail!("unsupported compression algorithm {} in zip-file", c),
},
},
);
}
Expand Down

0 comments on commit 4541146

Please sign in to comment.