mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
Merge pull request #11521 from NixOS/mergify/bp/2.24-maintenance/pr-8766
base64Decode: clearer error message when an invalid character is detected (backport #8766)
This commit is contained in:
commit
fc1d6b2f03
@ -260,8 +260,9 @@ std::string base64Decode(std::string_view s)
|
|||||||
if (c == '\n') continue;
|
if (c == '\n') continue;
|
||||||
|
|
||||||
char digit = base64DecodeChars[(unsigned char) c];
|
char digit = base64DecodeChars[(unsigned char) c];
|
||||||
if (digit == npos)
|
if (digit == npos) {
|
||||||
throw Error("invalid character in Base64 string: '%c'", c);
|
throw Error("invalid character in Base64 string: '%c' in '%s'", c, s.data());
|
||||||
|
}
|
||||||
|
|
||||||
bits += 6;
|
bits += 6;
|
||||||
d = d << 6 | digit;
|
d = d << 6 | digit;
|
||||||
|
Loading…
Reference in New Issue
Block a user