mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
AK+Everywhere: Make Base64 decoding fallible
This commit is contained in:
parent
3bf1f7ae87
commit
cb868cfa41
Notes:
sideshowbarker
2024-07-18 01:57:56 +09:00
Author: https://github.com/BenWiederhake
Commit: cb868cfa41
Pull-request: https://github.com/SerenityOS/serenity/pull/10590
Reviewed-by: https://github.com/linusg
11 changed files with 73 additions and 32 deletions
|
@ -197,7 +197,10 @@ Optional<HttpRequest::BasicAuthenticationCredentials> HttpRequest::parse_http_ba
|
|||
auto token = value.substring_view(6);
|
||||
if (token.is_empty())
|
||||
return {};
|
||||
auto decoded_token = String::copy(decode_base64(token));
|
||||
auto decoded_token_bb = decode_base64(token);
|
||||
if (!decoded_token_bb.has_value())
|
||||
return {};
|
||||
auto decoded_token = String::copy(decoded_token_bb.value());
|
||||
auto colon_index = decoded_token.find(':');
|
||||
if (!colon_index.has_value())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue