mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Bug 1562822 - P1. Return NS_ERROR_FILE_CORRUPTED when Safe Browsing cannot read the header of its database. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D42613 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
60f201dfd5
commit
22e8951110
@ -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);
|
||||
|
@ -684,7 +684,8 @@ nsresult LookupCache::LoadFromFile(nsCOMPtr<nsIFile>& 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);
|
||||
|
Loading…
Reference in New Issue
Block a user