mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 22:57:31 +09:00
Bug 1509685 - Add more bounds checking in nsMsgDBView::UpdateDisplayMessage() to avoid crashes
Tag #1311
This commit is contained in:
parent
d4b247abb3
commit
a5aa1c26bf
1 changed files with 6 additions and 0 deletions
|
|
@ -1136,6 +1136,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
||||||
nsString subject;
|
nsString subject;
|
||||||
|
if (viewPosition >= (nsMsgViewIndex)m_flags.Length())
|
||||||
|
return NS_MSG_INVALID_DBVIEW_INDEX;
|
||||||
FetchSubject(msgHdr, m_flags[viewPosition], subject);
|
FetchSubject(msgHdr, m_flags[viewPosition], subject);
|
||||||
|
|
||||||
nsCString keywords;
|
nsCString keywords;
|
||||||
|
|
@ -1148,6 +1150,8 @@ nsresult nsMsgDBView::UpdateDisplayMessage(nsMsgViewIndex viewPosition)
|
||||||
|
|
||||||
if (folder)
|
if (folder)
|
||||||
{
|
{
|
||||||
|
if (viewPosition >= (nsMsgViewIndex)m_keys.Length())
|
||||||
|
return NS_MSG_INVALID_DBVIEW_INDEX;
|
||||||
rv = folder->SetLastMessageLoaded(m_keys[viewPosition]);
|
rv = folder->SetLastMessageLoaded(m_keys[viewPosition]);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
}
|
}
|
||||||
|
|
@ -1175,6 +1179,8 @@ NS_IMETHODIMP nsMsgDBView::LoadMessageByViewIndex(nsMsgViewIndex aViewIndex)
|
||||||
nsCOMPtr<nsIMessenger> messenger (do_QueryReferent(mMessengerWeak));
|
nsCOMPtr<nsIMessenger> messenger (do_QueryReferent(mMessengerWeak));
|
||||||
NS_ENSURE_TRUE(messenger, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(messenger, NS_ERROR_FAILURE);
|
||||||
messenger->OpenURL(uri);
|
messenger->OpenURL(uri);
|
||||||
|
if (aViewIndex >= (nsMsgViewIndex)m_keys.Length())
|
||||||
|
return NS_MSG_INVALID_DBVIEW_INDEX;
|
||||||
m_currentlyDisplayedMsgKey = m_keys[aViewIndex];
|
m_currentlyDisplayedMsgKey = m_keys[aViewIndex];
|
||||||
m_currentlyDisplayedMsgUri = uri;
|
m_currentlyDisplayedMsgUri = uri;
|
||||||
m_currentlyDisplayedViewIndex = aViewIndex;
|
m_currentlyDisplayedViewIndex = aViewIndex;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue