diff options
author | Jan Engelhardt <[email protected]> | 2024-03-04 10:45:49 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-04 10:45:49 +0000 |
commit | c6b01fcc32956518ce010d4d367b844c006958d2 (patch) | |
tree | 3f7b4fdf40c8d4ca5d26825427c853b55e165c99 /src | |
parent | url: add remark to documentation about hardcoded // substring (#293) (diff) | |
download | vmime-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.cpp | 2 |
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] != ':') { |