summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornelson%bolyard.com <devnull@localhost>2010-03-28 18:03:43 +0000
committernelson%bolyard.com <devnull@localhost>2010-03-28 18:03:43 +0000
commit5989be2b7d7019a67ff8afda274b3d6d2023b6d7 (patch)
tree1c9b1c8962410c69f4a4d3e01e97a5ae1780d341
parent9847f4fd54d85ca699d98f8e26cd080c0fc2a5e1 (diff)
downloadnss-hg-5989be2b7d7019a67ff8afda274b3d6d2023b6d7.tar.gz
Bug 469623: Coverity bugs in nss/lib/pki
Patch contributed by Shailendra Jain <shailen.n.jain@gmail.com>
-rw-r--r--security/nss/lib/pki/pkibase.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/security/nss/lib/pki/pkibase.c b/security/nss/lib/pki/pkibase.c
index 9d62c7713..2c566048c 100644
--- a/security/nss/lib/pki/pkibase.c
+++ b/security/nss/lib/pki/pkibase.c
@@ -510,6 +510,11 @@ nssCertificateArray_FindBestCertificate (
* */
}
bestdc = nssCertificate_GetDecoding(bestCert);
+ if (!bestdc) {
+ nssCertificate_Destroy(bestCert);
+ bestCert = nssCertificate_AddRef(c);
+ continue;
+ }
/* time */
if (bestdc->isValidAtTime(bestdc, time)) {
/* The current best cert is valid at time */
@@ -1247,7 +1252,9 @@ NSSTime_SetPRTime (
{
NSSTime *rvTime;
rvTime = (timeOpt) ? timeOpt : nss_ZNEW(NULL, NSSTime);
- rvTime->prTime = prTime;
+ if (rvTime) {
+ rvTime->prTime = prTime;
+ }
return rvTime;
}