diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-11 12:08:20 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-11 12:09:53 +0800 |
commit | ac589d72a2490c0e6443f389b0398db8ef1d0196 (patch) | |
tree | 294ac3ff07de835a3f2a256ad93e48b02f970ca0 | |
parent | 476dec2351c75e3bf7355fbe111c604f32e5b558 (diff) | |
download | uxp-ac589d72a2490c0e6443f389b0398db8ef1d0196.tar.gz |
Issue #2078 - Follow-up: Ensure empty selector lists aren't iterated when serialized
Really odd that this wasn't caught/doesn't cause any issues on MSVC/unoptimized GCC. Must've been luck, I guess.
-rw-r--r-- | layout/style/StyleRule.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index 815c6f96cc..437806a1b8 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -1030,6 +1030,10 @@ nsCSSSelectorList::ToString(nsAString& aResult, CSSStyleSheet* aSheet) { aResult.Truncate(); nsCSSSelectorList *p = this; + // Don't append anything if we're an empty selector list. + if (!mSelectors) { + return; + } for (;;) { p->mSelectors->ToString(aResult, aSheet, true); p = p->mNext; |