From c6b01fcc32956518ce010d4d367b844c006958d2 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 4 Mar 2024 11:45:49 +0100 Subject: url: repair off-by-one bug in extractHost (#297) `hostPart[len]` is pointing to `]`, but we need to check the char after that. Fixes: v0.9.2-187-g874a1d8c --- src/vmime/utility/url.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/vmime/utility/url.cpp b/src/vmime/utility/url.cpp index 334e78fc..e8978d28 100644 --- a/src/vmime/utility/url.cpp +++ b/src/vmime/utility/url.cpp @@ -180,7 +180,7 @@ static bool extractHostIPv6(string& hostPart, string& host, string& port) { host.assign(&hostPart[1], len - 1); - if (hostPart[len] == '\0') { + if (hostPart[len + 1] == '\0') { return true; } if (hostPart[len + 1] != ':') { -- cgit v1.2.3