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
This commit is contained in:
dlee
2019-08-21 12:07:44 +00:00
parent 9bb56316eb
commit 12fa90c9a8
2 changed files with 6 additions and 2 deletions

View File

@@ -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);