mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb/CSS: Check for NULL block statement when parsing font-face rule
This prevents font-face rules without a block statement from crashing LibWeb during CSS parsing. The issue was discovered by Lubrsi during CSS parser fuzzing. :) Fixes #14141.
This commit is contained in:
parent
f807fe6f6c
commit
a02ee29af9
1 changed files with 1 additions and 1 deletions
|
@ -2361,7 +2361,7 @@ RefPtr<CSSRule> Parser::convert_to_rule(NonnullRefPtr<Rule> rule)
|
||||||
if (has_ignored_vendor_prefix(rule->at_rule_name())) {
|
if (has_ignored_vendor_prefix(rule->at_rule_name())) {
|
||||||
return {};
|
return {};
|
||||||
} else if (rule->at_rule_name().equals_ignoring_case("font-face"sv)) {
|
} else if (rule->at_rule_name().equals_ignoring_case("font-face"sv)) {
|
||||||
if (rule->prelude().is_empty() || !rule->block()->is_curly()) {
|
if (rule->prelude().is_empty() || !rule->block() || !rule->block()->is_curly()) {
|
||||||
dbgln_if(CSS_PARSER_DEBUG, "@font-face rule is malformed.");
|
dbgln_if(CSS_PARSER_DEBUG, "@font-face rule is malformed.");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue