mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 08:32:13 +11:00
🐛 fixed buffer size
This commit is contained in:
parent
2fe00e05de
commit
db5a54175c
1 changed files with 2 additions and 2 deletions
|
|
@ -9,12 +9,12 @@ void UserFilter<set_body_flag, require_admin>::doFilter(const HttpRequestPtr &re
|
||||||
FilterChainCallback &&fccb)
|
FilterChainCallback &&fccb)
|
||||||
{
|
{
|
||||||
std::string_view auth_header = req->getHeader("Authorization");
|
std::string_view auth_header = req->getHeader("Authorization");
|
||||||
if (auth_header.size() > 6 && auth_header.size() <= 517) //"Basic " + username + ':' + password
|
if (auth_header.size() > 6 && auth_header.size() <= 688) //"Basic " + (username + ':' + password) * 4/3
|
||||||
{
|
{
|
||||||
if (auth_header.substr(0, 6) == "Basic ")
|
if (auth_header.substr(0, 6) == "Basic ")
|
||||||
{
|
{
|
||||||
std::string_view base64_input = auth_header.substr(6);
|
std::string_view base64_input = auth_header.substr(6);
|
||||||
std::array<char, 384> base64_result; //(255 username + ':' + 255 password) * 3/4
|
std::array<char, 511> base64_result; //(255 username + ':' + 255 password)
|
||||||
size_t new_sz;
|
size_t new_sz;
|
||||||
base64_decode(base64_input.data(), base64_input.size(), base64_result.begin(), &new_sz, 0);
|
base64_decode(base64_input.data(), base64_input.size(), base64_result.begin(), &new_sz, 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue