summaryrefslogtreecommitdiffstats
path: root/mailnews/base/src/nsMsgDBView.cpp
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2019-12-06 19:18:39 -0500
committerGitHub <noreply@github.com>2019-12-06 19:18:39 -0500
commitca46bc1f603610dd7ba94b998ee7956699bc8d5c (patch)
tree20bcaf53435839502e6cb2239132913a101fec69 /mailnews/base/src/nsMsgDBView.cpp
parent2529b2edece0a0ed86553d1e73eef13c3848bf64 (diff)
parent282cdd6bafecd5b406f39151e6fba686f9e7f3c3 (diff)
downloadUXP-ca46bc1f603610dd7ba94b998ee7956699bc8d5c.tar
UXP-ca46bc1f603610dd7ba94b998ee7956699bc8d5c.tar.gz
UXP-ca46bc1f603610dd7ba94b998ee7956699bc8d5c.tar.lz
UXP-ca46bc1f603610dd7ba94b998ee7956699bc8d5c.tar.xz
UXP-ca46bc1f603610dd7ba94b998ee7956699bc8d5c.zip
Merge pull request #1314 from g4jc/mailnews_patches
Mailnews Nov/Dec Updates
Diffstat (limited to 'mailnews/base/src/nsMsgDBView.cpp')
-rw-r--r--mailnews/base/src/nsMsgDBView.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp
index 6793ba95a..5b82390c0 100644
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -1136,6 +1136,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
NS_ENSURE_SUCCESS(rv,rv);
nsString subject;
+ if (viewPosition >= (nsMsgViewIndex)m_flags.Length())
+ return NS_MSG_INVALID_DBVIEW_INDEX;
FetchSubject(msgHdr, m_flags[viewPosition], subject);
nsCString keywords;
@@ -1148,6 +1150,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
if (folder)
{
+ if (viewPosition >= (nsMsgViewIndex)m_keys.Length())
+ return NS_MSG_INVALID_DBVIEW_INDEX;
rv = folder->SetLastMessageLoaded(m_keys[viewPosition]);
NS_ENSURE_SUCCESS(rv,rv);
}
@@ -1175,6 +1179,8 @@ NS_IMETHODIMP nsMsgDBView::LoadMessageByViewIndex(nsMsgViewIndex aViewIndex)
nsCOMPtr<nsIMessenger> messenger (do_QueryReferent(mMessengerWeak));
NS_ENSURE_TRUE(messenger, NS_ERROR_FAILURE);
messenger->OpenURL(uri);
+ if (aViewIndex >= (nsMsgViewIndex)m_keys.Length())
+ return NS_MSG_INVALID_DBVIEW_INDEX;
m_currentlyDisplayedMsgKey = m_keys[aViewIndex];
m_currentlyDisplayedMsgUri = uri;
m_currentlyDisplayedViewIndex = aViewIndex;