aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Engelhardt <[email protected]>2024-03-04 10:45:49 +0000
committerGitHub <[email protected]>2024-03-04 10:45:49 +0000
commitc6b01fcc32956518ce010d4d367b844c006958d2 (patch)
tree3f7b4fdf40c8d4ca5d26825427c853b55e165c99 /src
parenturl: add remark to documentation about hardcoded // substring (#293) (diff)
downloadvmime-c6b01fcc32956518ce010d4d367b844c006958d2.tar.gz
vmime-c6b01fcc32956518ce010d4d367b844c006958d2.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/vmime/utility/url.cpp2
1 files changed, 1 insertions, 1 deletions
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] != ':') {