aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-06-24 20:58:18 +0100
committerGravatar Sadie Powell2026-06-24 20:58:18 +0100
commitdeb64dc167ad291f1e15ad670e5396903e3902e4 (patch)
tree91c4b943f42e543638ac8158b76a977cac50dbbf
parentUpdate the documentation regarding MMDB database vendors. (diff)
Fix null bytes not being encoded correctly by Percent::Encode.
-rw-r--r--src/stringutils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stringutils.cpp b/src/stringutils.cpp
index 46fb0a6c7..282d8a3c2 100644
--- a/src/stringutils.cpp
+++ b/src/stringutils.cpp
@@ -44,7 +44,7 @@ std::string Percent::Encode(const void* data, size_t length, const char* table,
for (size_t idx = 0; idx < length; ++idx)
{
unsigned char chr = udata[idx];
- if (strchr(table, chr))
+ if (memchr(table, chr, strlen(table)))
{
// The character is on the safe list; push it as is.
buffer.push_back(chr);