From deb64dc167ad291f1e15ad670e5396903e3902e4 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 24 Jun 2026 20:58:18 +0100 Subject: Fix null bytes not being encoded correctly by Percent::Encode. --- src/stringutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.3.1-10-gc9f91