Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions crates/bashkit/src/builtins/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ use flate2::write::GzEncoder;
use std::io::{Read, Write};
use std::path::Path;

use super::limits::ARCHIVE_MAX_DECOMPRESSION_RATIO as MAX_DECOMPRESSION_RATIO;
use super::{Builtin, Context, resolve_path};
use crate::error::Result;
use crate::interpreter::ExecResult;

/// Maximum decompression ratio to detect zip bombs.
/// A ratio over 100:1 is suspicious.
const MAX_DECOMPRESSION_RATIO: usize = 100;

/// Read from a decoder with size limits to prevent zip bombs.
///
/// Returns an error if the decompressed size exceeds the limit or
Expand Down
Loading
Loading