diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-02-16 12:17:56 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-02-16 12:17:56 +0100 |
commit | e0f7dae9ac8435a254aff53f98ca66a3ee93e658 (patch) | |
tree | 97d6e2abad21f9f355b3844611bea95b7e39602e | |
parent | 40627fc9edc2422c97d4287e33b7784b7202fc71 (diff) |
util.c: parseuri(): fix incorrect NUL termination for IPv6 addresses
-rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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. */ |