mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 22:24:56 +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, '/');
|
slash = strchr(url, '/');
|
||||||
at = strchr(url, '@');
|
at = strchr(url, '@');
|
||||||
|
|
||||||
if (slash == NULL) {
|
if (!slash ||
|
||||||
giterr_set(GITERR_NET, "Malformed URL: missing /");
|
(colon && slash < colon)) {
|
||||||
return -1;
|
giterr_set(GITERR_NET, "Malformed URL");
|
||||||
|
return GIT_EINVALIDSPEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
start = url;
|
start = url;
|
||||||
|
Loading…
Reference in New Issue
Block a user