5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-01-08 01:17:40 +03:00

decoder: forbid slashes in file names

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-06-08 10:26:36 +02:00
parent ef72634f27
commit 2dfb36020a

View File

@ -317,6 +317,9 @@ impl<I: SeqRead> DecoderImpl<I> {
if data.is_empty() {
io_bail!("illegal path found (empty)");
}
if data.contains(&b'/') {
io_bail!("illegal path found (contains slashes, this is a security concern)");
}
let path = PathBuf::from(OsString::from_vec(data));
self.set_path(&path)?;