summaryrefslogtreecommitdiff
path: root/src/netops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/netops.c')
-rw-r--r--src/netops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/netops.c b/src/netops.c
index 7a61ef820..7e13f12e7 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -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;