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 committed by Arkadiusz Hiler
parent e190c26058
commit f1893068c3

View file

@ -272,6 +272,11 @@ impl StreamArchive {
match res {
Ok(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);
},