mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-14 16:58:34 +00:00
Fix out of bounds read in base64_decode
This commit is contained in:
parent
64de7b6f1d
commit
8cb5ea3d5e
2 changed files with 15 additions and 1 deletions
|
@ -200,7 +200,7 @@ inline std::string base64_decode(const char* in, size_t len)
|
|||
|
||||
constexpr static const DMap dmap{};
|
||||
|
||||
while (dmap.at(in[bytes_rem - 1]) == -1) { bytes_rem--; }
|
||||
while (bytes_rem > 0 && dmap.at(in[bytes_rem - 1]) == -1) { bytes_rem--; }
|
||||
|
||||
while (bytes_rem > 4)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue