Skip to content

Commit

Permalink
Revert "base64Decode: clearer error message when an invalid character…
Browse files Browse the repository at this point in the history
… is detected"

We have a safer way of doing this.

This reverts commit dc3ccf0.
  • Loading branch information
Ericson2314 committed Sep 20, 2024
1 parent 68ba6ff commit d0c351b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libutil/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ std::string base64Decode(std::string_view s)
if (c == '\n') continue;

char digit = base64DecodeChars[(unsigned char) c];
if (digit == npos) {
throw Error("invalid character in Base64 string: '%c' in '%s'", c, s.data());
}
if (digit == npos)
throw Error("invalid character in Base64 string: '%c'", c);

bits += 6;
d = d << 6 | digit;
Expand Down

0 comments on commit d0c351b

Please sign in to comment.