From 53624e26de4abcf5582cbf4ba417b7d9afa017c7 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 2 Oct 2001 21:51:11 +0000 Subject: [PATCH] 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 --- mailnews/imap/src/nsImapFlagAndUidState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mailnews/imap/src/nsImapFlagAndUidState.cpp b/mailnews/imap/src/nsImapFlagAndUidState.cpp index 1cbcb48ad9e..5a761f113e6 100644 --- a/mailnews/imap/src/nsImapFlagAndUidState.cpp +++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp @@ -164,6 +164,10 @@ NS_IMETHODIMP nsImapFlagAndUidState::Reset(PRUint32 howManyLeft) 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; if ((PRUint32) fNumberOfMessagesAdded < msgIndex)