summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-03 11:10:44 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-05 18:42:30 +0000
commitcca738e986de696cbd414a9d35209d6aa166ae5e (patch)
tree347a68d9427a12cb3f0aabd7f50f86d9014f91fb /layout
parent304496d4ab61496a43d9d42cf8deb7811d772fe2 (diff)
downloadUXP-cca738e986de696cbd414a9d35209d6aa166ae5e.tar
UXP-cca738e986de696cbd414a9d35209d6aa166ae5e.tar.gz
UXP-cca738e986de696cbd414a9d35209d6aa166ae5e.tar.lz
UXP-cca738e986de696cbd414a9d35209d6aa166ae5e.tar.xz
UXP-cca738e986de696cbd414a9d35209d6aa166ae5e.zip
Issue #1515 - Add null check to nsCSSFrameConstructor::IsValidSibling
With the changes to layout for WebComponents, it is now apparently possible to pass in null for frame tree items to this function, which would cause a null deref crash if not checked.
Diffstat (limited to 'layout')
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 2cc5ec818..b40e6f8b6 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6464,6 +6464,11 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
nsIContent* aContent,
StyleDisplay& aDisplay)
{
+ if (!aSibling || !aContent) {
+ // If either of these are null, no sane comparison can be made.
+ return false;
+ }
+
nsIFrame* parentFrame = aSibling->GetParent();
nsIAtom* parentType = parentFrame->GetType();