Bug 1314347 - Crash in InvalidArrayIndex_CRASH | nsMsgDBView::GetCommandStatus (analysis by alta88). r=rkent a=IanN SEA_COMM510_20170330_RELBRANCH SEAMONKEY_2_48_BUILD1 SEAMONKEY_2_48_RELEASE
authorJorg K <jorgk@jorgk.com>
Sat, 15 Oct 2016 14:09:39 -0400
branchSEA_COMM510_20170330_RELBRANCH
changeset 31418 00de3083c5db2fcb1544d5f9edd8bdae5e039b03
parent 31417 ab1049e98f0ec11c740c434d52b5508dd1f94018
child 31419 743567e9015a43703b9b9a51aeb3cc5b739fcd19
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrkent, IanN
bugs1314347
Bug 1314347 - Crash in InvalidArrayIndex_CRASH | nsMsgDBView::GetCommandStatus (analysis by alta88). r=rkent a=IanN
mailnews/base/src/nsMsgDBView.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -2759,17 +2759,17 @@ NS_IMETHODIMP nsMsgDBView::GetCommandSta
   case nsMsgViewCommandType::unflagMessages:
   case nsMsgViewCommandType::toggleThreadWatched:
   case nsMsgViewCommandType::markThreadRead:
   case nsMsgViewCommandType::downloadSelectedForOffline:
     *selectable_p = haveSelection;
     break;
   case nsMsgViewCommandType::junk:
   case nsMsgViewCommandType::unjunk:
-    *selectable_p = haveSelection && JunkControlsEnabled(selection[0]);
+    *selectable_p = haveSelection && numIndices && JunkControlsEnabled(selection[0]);
     break;
   case nsMsgViewCommandType::cmdRequiringMsgBody:
     *selectable_p = haveSelection && (!WeAreOffline() || OfflineMsgSelected(indices, numIndices));
     break;
   case nsMsgViewCommandType::downloadFlaggedForOffline:
   case nsMsgViewCommandType::markAllRead:
     *selectable_p = true;
     break;