From a0df4b2f2c4484a06ecb0f496cebe62081e2902d Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 4 Mar 2011 12:47:09 -0800 Subject: Add invalid id check to isValidParent Bug: 3512786 Change-Id: I8f16038e230a24bcc50e4cc75d24f413d0166844 --- src/com/android/browser/provider/BrowserProvider2.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/com/android/browser/provider') diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index c6b1bc7..305c794 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -1236,6 +1236,9 @@ public class BrowserProvider2 extends SQLiteContentProvider { private boolean isValidParent(String accountType, String accountName, long parentId) { + if (parentId <= 0) { + return false; + } Uri uri = ContentUris.withAppendedId(Bookmarks.CONTENT_URI, parentId); Cursor c = query(uri, new String[] { Bookmarks.ACCOUNT_NAME, Bookmarks.ACCOUNT_TYPE }, -- cgit v1.1