Skip to content

Commit 9158ffc

Browse files
committed
Add another failing gix-url test-case found by the fuzzer.
It overflows some number in Debug mode.
1 parent d78f445 commit 9158ffc

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ws:// . ݆ 􊘵 %55 . /

gix-url/tests/fuzzed.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ use std::time::Duration;
55
#[test]
66
#[cfg_attr(debug_assertions, ignore = "fails due to integer overflow")]
77
fn abort_unfixed_in_debug_mode() {
8-
let name = "very-long-abort";
9-
let base = Path::new("tests").join("fixtures").join("fuzzed");
10-
let location = base.join(Path::new(name).with_extension("url"));
11-
let url = std::fs::read(&location).unwrap();
12-
let start = std::time::Instant::now();
13-
gix_url::parse(url.as_bstr()).ok();
14-
assert!(
15-
start.elapsed() < Duration::from_millis(100),
16-
"URL at '{}' parsed too slowly, took {:.00}s",
17-
location.display(),
18-
start.elapsed().as_secs_f32()
19-
);
8+
for name in ["very-long-abort2", "very-long-abort"] {
9+
let base = Path::new("tests").join("fixtures").join("fuzzed");
10+
let location = base.join(Path::new(name).with_extension("url"));
11+
let url = std::fs::read(&location).unwrap();
12+
let start = std::time::Instant::now();
13+
dbg!(name);
14+
gix_url::parse(url.as_bstr()).ok();
15+
assert!(
16+
start.elapsed() < Duration::from_millis(100),
17+
"URL at '{}' parsed too slowly, took {:.00}s",
18+
location.display(),
19+
start.elapsed().as_secs_f32()
20+
);
21+
}
2022
}
2123

2224
#[test]

0 commit comments

Comments
 (0)