Skip to content

Commit bc978ca

Browse files
CopilotByron
andcommitted
Fix fuzzer crash - validate host exists when user is specified
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
1 parent 684979d commit bc978ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gix-url/src/simple_url.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ impl<'a> ParsedUrl<'a> {
8282
};
8383

8484
let (h, p) = Self::parse_host_port(host_port)?;
85+
// If we have user info, we must have a host
86+
if h.is_none() {
87+
return Err(ParseError::InvalidDomainCharacter);
88+
}
8589
(user, pass, h, p)
8690
} else {
8791
// No user info

0 commit comments

Comments
 (0)