media-converter: Don't panic on unknown tags for read-only DBs

CW-Bug-Id: #19516
This commit is contained in:
Andrew Eikum 2021-12-03 09:08:02 -06:00
parent 58fa33d121
commit 5934b82eda

View File

@ -272,6 +272,11 @@ impl StreamArchive {
match res { match res {
Ok(p) => { Ok(p) => {
self.write_pos = p; self.write_pos = p;
if tag >= self.seen_blobs.len() &&
self.file.metadata()?.permissions().readonly() {
/* ignore unknown tags for read-only DBs, otherwise panic */
continue;
}
self.seen_blobs[tag].insert(hash, payload_entry); self.seen_blobs[tag].insert(hash, payload_entry);
}, },