Bug 823093 - Skip permission entries with invalid appId. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 20 Dec 2012 13:25:36 +0100
changeset 130688 6a1cddcd2070ca0d44fbbf29ee284a1f0957a38a
parent 130687 12cbe5187dc9e3ddc3c7dd798d8f2664dda60a5e
child 130689 0ce0640303967ccddb83ceec983ef1a5dfec83a5
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs823093
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 823093 - Skip permission entries with invalid appId. r=sicking
extensions/cookie/nsPermissionManager.cpp
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -1449,17 +1449,20 @@ nsPermissionManager::Read()
     }
 
     permission = stmt->AsInt32(3);
     expireType = stmt->AsInt32(4);
 
     // convert into int64_t value (milliseconds)
     expireTime = stmt->AsInt64(5);
 
-    MOZ_ASSERT(stmt->AsInt64(6) >= 0);
+    if (stmt->AsInt64(6) < 0) {
+      readError = true;
+      continue;
+    }
     appId = static_cast<uint32_t>(stmt->AsInt64(6));
     isInBrowserElement = static_cast<bool>(stmt->AsInt32(7));
 
     nsCOMPtr<nsIPrincipal> principal;
     nsresult rv = GetPrincipal(host, appId, isInBrowserElement, getter_AddRefs(principal));
     if (NS_FAILED(rv)) {
       readError = true;
       continue;