diff --git a/toolkit/components/url-classifier/HashStore.cpp b/toolkit/components/url-classifier/HashStore.cpp index d39c1232b179..9dea1d2bcb05 100644 --- a/toolkit/components/url-classifier/HashStore.cpp +++ b/toolkit/components/url-classifier/HashStore.cpp @@ -333,7 +333,10 @@ nsresult HashStore::Open(uint32_t aVersion) { NS_ENSURE_SUCCESS(rv, rv); rv = ReadHeader(); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + LOG(("Failed to read header for %s", mTableName.get())); + return NS_ERROR_FILE_CORRUPTED; + } rv = SanityCheck(aVersion); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/components/url-classifier/LookupCache.cpp b/toolkit/components/url-classifier/LookupCache.cpp index 6ff62109f254..7e72353e11dd 100644 --- a/toolkit/components/url-classifier/LookupCache.cpp +++ b/toolkit/components/url-classifier/LookupCache.cpp @@ -684,7 +684,8 @@ nsresult LookupCache::LoadFromFile(nsCOMPtr& aFile) { Header header; rv = ReadValue(in, header); if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; + LOG(("Failed to read header for %s", mTableName.get())); + return NS_ERROR_FILE_CORRUPTED; } rv = SanityCheck(header);