]> git.proxmox.com Git - pxar.git/commit
header: add size checks
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 12 Jun 2020 07:21:39 +0000 (09:21 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 12 Jun 2020 07:46:01 +0000 (09:46 +0200)
commitec0761f9db260d5319fb82e277cbb99d8a4299e0
treea3d625da64f3cc90340911146a21c3a55967192e
parent3c8ca95cbd68cdb8deb5cea907ae298ffd0cfb0f
header: add size checks

to catch
- headers with full_size < size_of::<Header>
- headers with content_size > header-specific limit

both should in practice only occur for corrupted streams/archives, but
panic-ing/attempting to allocate huge amounts of memory should be
avoided even for those.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/decoder/mod.rs
src/encoder/mod.rs
src/format/mod.rs
src/util.rs