From 914ca8793b8014ff0c51f53c8b927d702a343bce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Csaba=20Osztrogon=C3=A1c?= Date: Fri, 6 Mar 2015 07:33:11 +0000 Subject: [PATCH] Check for NULL pointer in ApplyStyleCommand =================================================================== Gbp-Pq: Name nullptr-applystylecommand.patch --- Source/WebCore/editing/ApplyStyleCommand.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/WebCore/editing/ApplyStyleCommand.cpp b/Source/WebCore/editing/ApplyStyleCommand.cpp index 55377c69f5..e756e95fe7 100644 --- a/Source/WebCore/editing/ApplyStyleCommand.cpp +++ b/Source/WebCore/editing/ApplyStyleCommand.cpp @@ -257,6 +257,9 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style) // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints. // Calculate start and end indices from the start of the tree that they're in. Node* scope = highestEditableRoot(visibleStart.deepEquivalent()); + if (!scope) + return; + RefPtr startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); RefPtr endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); int startIndex = TextIterator::rangeLength(startRange.get(), true); -- 2.30.2