mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 06:29:45 +00:00
Prevent segfault with a badly-formed URL
This commit is contained in:
parent
7be5104d24
commit
151b321898
@ -679,9 +679,10 @@ int gitno_extract_url_parts(
|
||||
slash = strchr(url, '/');
|
||||
at = strchr(url, '@');
|
||||
|
||||
if (slash == NULL) {
|
||||
giterr_set(GITERR_NET, "Malformed URL: missing /");
|
||||
return -1;
|
||||
if (!slash ||
|
||||
(colon && slash < colon)) {
|
||||
giterr_set(GITERR_NET, "Malformed URL");
|
||||
return GIT_EINVALIDSPEC;
|
||||
}
|
||||
|
||||
start = url;
|
||||
|
Loading…
Reference in New Issue
Block a user