From: Csaba Osztrogonác Date: Fri, 6 Mar 2015 07:33:11 +0000 (+0000) Subject: Check for NULL pointer in ApplyStyleCommand X-Git-Tag: archive/raspbian/2.14.3-1+rpi1~1^2^2^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=914ca8793b8014ff0c51f53c8b927d702a343bce;p=webkit2gtk.git Check for NULL pointer in ApplyStyleCommand =================================================================== Gbp-Pq: Name nullptr-applystylecommand.patch --- 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);