summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/url.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/url.c b/utils/url.c
index dcdfc14fc..ac4f74013 100644
--- a/utils/url.c
+++ b/utils/url.c
@@ -309,7 +309,8 @@ char *url_join(const char *rel, const char *base)
}
path_len = i;
/* d) */
- if (buf[path_len - 2] == '/' && buf[path_len - 1] == '.')
+ if (2 <= path_len && buf[path_len - 2] == '/' &&
+ buf[path_len - 1] == '.')
path_len--;
/* e) and f) */
while (1) {