From d8857c357eb2d28ab3cb527dc5ea439bc7100c8a Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 18:18:54 +0000 Subject: [PATCH] bounds-check bookmark notifications. bug 322379 r=brettw Original committer: bryner%brianryner.com Original revision: 1.30 Original date: 2006/01/06 01:38:44 git-svn-id: svn://10.0.0.236/trunk@202955 18797224-902f-48f8-a5cc-f745e15eee43 --- .../toolkit/components/places/src/nsNavHistoryResult.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp b/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp index 7c973973b06..ee71c29dd8a 100644 --- a/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp +++ b/mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp @@ -644,6 +644,10 @@ nsNavHistoryQueryNode::OnItemRemoved(nsIURI *aBookmark, PRInt64 aFolder, PRInt32 aIndex) { if (FolderId() == aFolder) { + if (aIndex < 0 || aIndex >= mChildren.Count()) { + return NS_ERROR_INVALID_ARG; + } + // If we're not expanded, we can just invalidate our child list // and rebuild it the next time we're opened. if (!mExpanded) { @@ -817,6 +821,10 @@ nsNavHistoryQueryNode::OnFolderRemoved(PRInt64 aFolder, PRInt64 aParent, PRInt32 aIndex) { if (FolderId() == aParent) { + if (aIndex < 0 || aIndex >= mChildren.Count()) { + return NS_ERROR_INVALID_ARG; + } + // If we're not expanded, we can just invalidate our child list // and rebuild it the next time we're opened. if (!mExpanded) {