mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05: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())) {
|
||||
return {};
|
||||
} 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.");
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue