Bug #97497 --> Try to protect against a crash in nsUint32Array where the server may be giving us a bogus message key.

r=naving
sr=bienvenu
This commit is contained in:
mscott%netscape.com 2001-10-02 21:51:11 +00:00
Родитель 3b1e15e6fd
Коммит 53624e26de
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -164,6 +164,10 @@ NS_IMETHODIMP nsImapFlagAndUidState::Reset(PRUint32 howManyLeft)
NS_IMETHODIMP nsImapFlagAndUidState::ExpungeByIndex(PRUint32 msgIndex) NS_IMETHODIMP nsImapFlagAndUidState::ExpungeByIndex(PRUint32 msgIndex)
{ {
// protect ourselves in case the server gave us an index key of -1.....
if ((PRInt32) msgIndex < 0)
return NS_ERROR_INVALID_ARG;
PRUint32 counter = 0; PRUint32 counter = 0;
if ((PRUint32) fNumberOfMessagesAdded < msgIndex) if ((PRUint32) fNumberOfMessagesAdded < msgIndex)