Skip to content

Commit 238a796

Browse files
Merge branch 'main' into proofs/idris2-131-audit-trail-completeness-redesign
2 parents f6cc5e5 + 0c8838d commit 238a796

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

impl/rust-cli/fuzz/fuzz_targets/fuzz_glob_expansion.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![no_main]
1212

1313
use libfuzzer_sys::fuzz_target;
14+
use tempfile::TempDir;
1415
use vsh::glob::expand_glob;
1516

1617
fuzz_target!(|data: &[u8]| {
@@ -33,12 +34,18 @@ fuzz_target!(|data: &[u8]| {
3334
return;
3435
}
3536

37+
// Create temporary directory for glob expansion
38+
let temp = match TempDir::new() {
39+
Ok(t) => t,
40+
Err(_) => return,
41+
};
42+
3643
// Expand glob (should complete quickly or return error)
3744
// Should NEVER:
3845
// - Hang (exponential backtracking)
3946
// - Panic
4047
// - Use excessive memory
41-
let _ = expand_glob(pattern);
48+
let _ = expand_glob(pattern, temp.path());
4249

4350
// Test cases include:
4451
// - Simple wildcards: *.txt, file?.rs

0 commit comments

Comments
 (0)