Bug 1298130 - Fix a potential null pointer dereference. r=smaug
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 31 Aug 2016 10:36:13 -0400
changeset 312084 5f2944711e5cd62cbc03b0e9dbb59f257ac5aa8b
parent 312083 bccb467cbc4f7f409185efbc979e7fd4301d8483
child 312085 d4ab78fba118163bc90674338e2ef1408dbe9902
push id30632
push userryanvm@gmail.com
push dateThu, 01 Sep 2016 02:33:28 +0000
treeherdermozilla-central@b7f7ae14590a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1298130
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1298130 - Fix a potential null pointer dereference. r=smaug MozReview-Commit-ID: LjmxTdfbJU5
layout/base/TouchManager.cpp
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -228,17 +228,17 @@ TouchManager::PreHandleEvent(WidgetEvent
 
         int32_t id = touch->Identifier();
         TouchInfo info;
         if (!sCaptureTouchList->Get(id, &info)) {
           continue;
         }
         nsCOMPtr<EventTarget> targetPtr = info.mTouch->mTarget;
         nsCOMPtr<nsINode> targetNode(do_QueryInterface(targetPtr));
-        if (!targetNode->IsInComposedDoc()) {
+        if (targetNode && !targetNode->IsInComposedDoc()) {
           targetPtr = do_QueryInterface(info.mNonAnonymousTarget);
         }
 
         aCurrentEventContent = do_QueryInterface(targetPtr);
         touch->SetTarget(targetPtr);
         sCaptureTouchList->Remove(id);
       }
       // add any touches left in the touch list, but ensure changed=false