From e0f7dae9ac8435a254aff53f98ca66a3ee93e658 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 16 Feb 2018 12:17:56 +0100 Subject: util.c: parseuri(): fix incorrect NUL termination for IPv6 addresses --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 0dd2431..01237b0 100644 --- a/util.c +++ b/util.c @@ -53,7 +53,7 @@ parseuri(const char *s, struct uri *u, int rel) if (!(b = strchr(p, ']')) || b - p >= (ssize_t)sizeof(u->host)) return -1; memcpy(u->host, p + 1, b - p - 1); - u->host[b - p] = '\0'; + u->host[b - p - 1] = '\0'; p = b + 1; } else { /* domain / host part, skip until port, path or end. */ -- cgit v1.2.3