pub struct ArchiveLimits {
pub max_entries: usize,
pub max_entry_size: u64,
pub max_total_size: u64,
pub max_compression_ratio: u64,
}Expand description
Bounds on what an archive may make the converter decompress — the guard against ZIP bombs and resource exhaustion on untrusted input. Checked against the central directory before anything is inflated; extraction then stops at the size an entry declared, so a header that understates its entry cannot get past them either.
Fields§
§max_entries: usizeEntries considered at most (directories excluded); the rest are skipped. Default 10 000.
max_entry_size: u64Largest uncompressed entry converted. Default 256 MiB.
max_total_size: u64Uncompressed bytes the converted entries may add up to. Default 1 GiB.
max_compression_ratio: u64Largest uncompressed : compressed ratio accepted for an entry over 1 MiB (text compresses 5–20×; a bomb, 1000× and more). Default 200.
Implementations§
Source§impl ArchiveLimits
impl ArchiveLimits
Trait Implementations§
Source§impl Clone for ArchiveLimits
impl Clone for ArchiveLimits
impl Copy for ArchiveLimits
Source§impl Debug for ArchiveLimits
impl Debug for ArchiveLimits
Source§impl Default for ArchiveLimits
impl Default for ArchiveLimits
impl Eq for ArchiveLimits
Source§impl PartialEq for ArchiveLimits
impl PartialEq for ArchiveLimits
impl StructuralPartialEq for ArchiveLimits
Auto Trait Implementations§
impl Freeze for ArchiveLimits
impl RefUnwindSafe for ArchiveLimits
impl Send for ArchiveLimits
impl Sync for ArchiveLimits
impl Unpin for ArchiveLimits
impl UnsafeUnpin for ArchiveLimits
impl UnwindSafe for ArchiveLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().