Bug 933995 - Check return value of ImportCertsIntoPermanentStorage and CERT_ImportCerts. r=dkeeler

This commit is contained in:
Michael Shuen 2013-11-06 12:30:45 -05:00
Родитель 8b52db17b7
Коммит b39e616813
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -520,11 +520,11 @@ ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCe
chainNode = CERT_LIST_NEXT(chainNode), i++) {
rawArray[i] = &chainNode->cert->derCert;
}
CERT_ImportCerts(certdb, usage, chainLen,
rawArray, nullptr, true, caOnly, nullptr);
SECStatus srv = CERT_ImportCerts(certdb, usage, chainLen, rawArray,
nullptr, true, caOnly, nullptr);
PORT_Free(rawArray);
return SECSuccess;
PORT_Free(rawArray);
return srv;
}
@ -800,7 +800,10 @@ nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfac
continue;
}
ImportCertsIntoPermanentStorage(certChain, certUsageAnyCA, true);
rv = ImportCertsIntoPermanentStorage(certChain, certUsageAnyCA, true);
if (rv != SECSuccess) {
return NS_ERROR_FAILURE;
}
}
return NS_OK;