summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-03 11:10:44 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-03 11:10:44 +0000
commitc5ad76a2875ca5c06c5bbff7b2f2e3ff7b3599c3 (patch)
tree6d91693b457f4b218398f1437df9de15edaac900
parentce297b972b0025fafd69245212facf09a3a71c1a (diff)
downloaduxp-c5ad76a2875ca5c06c5bbff7b2f2e3ff7b3599c3.tar.gz
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.
-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 2cc5ec818d..b40e6f8b61 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();