LibWeb: Fix SRI handling of badly-formatted strings

This commit is contained in:
Lyra 2025-05-06 15:41:23 +02:00 committed by Tim Flynn
parent 0da7441b9b
commit 39dae6fb2d
Notes: github-actions[bot] 2025-05-06 17:03:57 +00:00
3 changed files with 18 additions and 1 deletions

View file

@ -90,7 +90,7 @@ ErrorOr<Vector<Metadata>> parse_metadata(StringView metadata)
auto algorithm = hash_expr_token_list[0];
// 6. If hash-expr-token-list[1] exists, set base64-value to hash-expr-token-list[1].
if (hash_expr_token_list.size() >= 1)
if (hash_expr_token_list.size() > 1)
base64_value = hash_expr_token_list[1];
// 7. If algorithm is not a hash function recognized by the user agent, continue.