mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-05-29 22:13:09 +00:00
tape: avoid panic potential in MAM attribute decoder
We already saw that quite some tape libraries/loaders/... ain't always _that_ standard conform, and even if it'd be guaranteed, it just makes no sense to create a potential for panicking the whole daemon due to some sub-features hiccup, rather go for actual error handling... Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a4ff2cdc54
commit
a18a63c827
@ -257,7 +257,7 @@ fn decode_mam_attributes(data: &[u8]) -> Result<Vec<MamAttribute>, Error> {
|
|||||||
format!("{}", u64::from_be_bytes(data[0..8].try_into()?))
|
format!("{}", u64::from_be_bytes(data[0..8].try_into()?))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unreachable!();
|
bail!("unexpected MAM attribute length {}", info.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MamFormat::BINARY => hex::encode(&data),
|
MamFormat::BINARY => hex::encode(&data),
|
||||||
|
Loading…
Reference in New Issue
Block a user