We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f6cc5e5 + 0c8838d commit 238a796Copy full SHA for 238a796
1 file changed
impl/rust-cli/fuzz/fuzz_targets/fuzz_glob_expansion.rs
@@ -11,6 +11,7 @@
11
#![no_main]
12
13
use libfuzzer_sys::fuzz_target;
14
+use tempfile::TempDir;
15
use vsh::glob::expand_glob;
16
17
fuzz_target!(|data: &[u8]| {
@@ -33,12 +34,18 @@ fuzz_target!(|data: &[u8]| {
33
34
return;
35
}
36
37
+ // Create temporary directory for glob expansion
38
+ let temp = match TempDir::new() {
39
+ Ok(t) => t,
40
+ Err(_) => return,
41
+ };
42
+
43
// Expand glob (should complete quickly or return error)
44
// Should NEVER:
45
// - Hang (exponential backtracking)
46
// - Panic
47
// - Use excessive memory
- let _ = expand_glob(pattern);
48
+ let _ = expand_glob(pattern, temp.path());
49
50
// Test cases include:
51
// - Simple wildcards: *.txt, file?.rs
0 commit comments