mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibWeb: Fix SRI handling of badly-formatted strings
This commit is contained in:
parent
0da7441b9b
commit
39dae6fb2d
Notes:
github-actions[bot]
2025-05-06 17:03:57 +00:00
Author: https://github.com/teromene 🔰
Commit: 39dae6fb2d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4624
Reviewed-by: https://github.com/trflynn89
3 changed files with 18 additions and 1 deletions
|
@ -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.
|
||||
|
|
1
Tests/LibWeb/Crash/HTML/invalid-integrity-attribute.css
Normal file
1
Tests/LibWeb/Crash/HTML/invalid-integrity-attribute.css
Normal file
|
@ -0,0 +1 @@
|
|||
.body {}
|
16
Tests/LibWeb/Crash/HTML/invalid-integrity-attribute.html
Normal file
16
Tests/LibWeb/Crash/HTML/invalid-integrity-attribute.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link
|
||||
href="invalid-integrity-attribute.css"
|
||||
type="text/css"
|
||||
rel="stylesheet"
|
||||
crossorigin="anonymous"
|
||||
integrity="051df3b15e50dd8711b1fa2f4e11f69060b4d77e0a3950a5ae2dc9f5c6bf8a37"
|
||||
nonce=""
|
||||
>
|
||||
<title>Test</title>
|
||||
</head>
|
||||
<body>
|
Loading…
Add table
Add a link
Reference in a new issue