Skip to content

Commit 21729ed

Browse files
committed
fix yet another fuzzed test-case related to url::parse DoS
1 parent 7f67b97 commit 21729ed

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

gix-url/src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub(crate) fn url(input: &BStr, protocol_end: usize) -> Result<crate::Url, Error
8787
let bytes_to_path = input[protocol_end + "://".len()..]
8888
.iter()
8989
.filter(|b| !b.is_ascii_whitespace())
90-
.skip_while(|b| **b == b'/')
90+
.skip_while(|b| **b == b'/' || **b == b'\\')
9191
.position(|b| *b == b'/')
9292
.unwrap_or(input.len() - protocol_end);
9393
if bytes_to_path > MAX_LEN || protocol_end > MAX_LEN {
111 KB
Binary file not shown.

gix-url/tests/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mod unknown {
139139

140140
#[test]
141141
fn fuzzed() {
142-
for name in ["very-long4", "very-long3", "very-long2", "very-long"] {
142+
for name in ["very-long5", "very-long4", "very-long3", "very-long2", "very-long"] {
143143
let base = Path::new("tests").join("fixtures").join("fuzzed");
144144
let location = base.join(Path::new(name).with_extension("url"));
145145
let url = std::fs::read(&location).unwrap();

0 commit comments

Comments
 (0)