Files
Václav Slavík 5e2ad7cb1e winsparkle-tool: Fix superfluous null in base64 output
CryptBinaryToString() returns, when passed aNULL buffer, not size of the
encoded string, but size of the buffer requires, i.e. including the
trailing null.

The code incorrectly used this value to as std::string's size, resulting
in embedded trailing null in the output.

Fix by sizing the string properly. Note that this is safe in C++17,
which we rely on by using non-const data(): the buffer returned by
data() is guaranteed to be terminated with a trailing '\0' and this
value is writeable, as long as the value written is '\0' - which is what
CryptBinaryToString() will do.

Fixes #289.
2025-06-28 12:02:44 +02:00
..