diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-03 11:10:44 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-05 18:42:30 +0000 |
commit | cca738e986de696cbd414a9d35209d6aa166ae5e (patch) | |
tree | 347a68d9427a12cb3f0aabd7f50f86d9014f91fb | |
parent | 304496d4ab61496a43d9d42cf8deb7811d772fe2 (diff) | |
download | uxp-cca738e986de696cbd414a9d35209d6aa166ae5e.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.cpp | 5 |
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(); |