Bug 1273128 - prevent null pointer dereference on |nativeKeyEvent|. r=janv
authorAndi-Bogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Mon, 16 May 2016 16:19:23 +0300
changeset 298595 a2cfd126f1e597ea91cc20b391d13910d4a4606e
parent 298594 49fbf8516de958ddc668ebd8b3d45aba9b81d84f
child 298596 df5daa1095f2d2b0c71c6f50f308dc9e2daa8c13
push id77241
push userBogdan.Postelnicu@softvision.ro
push dateTue, 24 May 2016 07:28:44 +0000
treeherdermozilla-inbound@a2cfd126f1e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv
bugs1273128
milestone49.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 1273128 - prevent null pointer dereference on |nativeKeyEvent|. r=janv MozReview-Commit-ID: IOnUZfZHcnG
layout/xul/nsMenuBarListener.cpp
--- a/layout/xul/nsMenuBarListener.cpp
+++ b/layout/xul/nsMenuBarListener.cpp
@@ -206,17 +206,17 @@ nsMenuBarListener::KeyPress(nsIDOMEvent*
   InitAccessKey();
 
   if (mAccessKey)
   {
     // If accesskey handling was forwarded to a child process, wait for
     // the mozaccesskeynotfound event before handling accesskeys.
     WidgetKeyboardEvent* nativeKeyEvent =
       aKeyEvent->WidgetEventPtr()->AsKeyboardEvent();
-    if (nativeKeyEvent->mAccessKeyForwardedToChild) {
+    if (nativeKeyEvent && nativeKeyEvent->mAccessKeyForwardedToChild) {
       return NS_OK;
     }
 
     nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aKeyEvent);
     uint32_t keyCode, charCode;
     keyEvent->GetKeyCode(&keyCode);
     keyEvent->GetCharCode(&charCode);