Commit 151b3218 by Ben Straub

Prevent segfault with a badly-formed URL

parent 7be5104d
...@@ -679,9 +679,10 @@ int gitno_extract_url_parts( ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment