From bd1ad42705f39df10c355c40d15b5157feda859b Mon Sep 17 00:00:00 2001 From: "ian.mcgreer%sun.com" Date: Tue, 6 Nov 2001 20:32:43 +0000 Subject: [PATCH] fix for 95983, compiler warning revealed potential bug --- security/nss/lib/jar/jarver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/security/nss/lib/jar/jarver.c b/security/nss/lib/jar/jarver.c index cc6ab88b243..a7f5bdb77f2 100644 --- a/security/nss/lib/jar/jarver.c +++ b/security/nss/lib/jar/jarver.c @@ -1684,12 +1684,15 @@ static int jar_validate_pkcs7 (jar_catch_bytes, NULL /*cb_arg*/, NULL /*getpassword*/, jar->mw, NULL, NULL, NULL); - if (dcx != NULL) + if (dcx == NULL) { - SEC_PKCS7DecoderUpdate (dcx, data, length); - cinfo = SEC_PKCS7DecoderFinish (dcx); + /* strange pkcs7 failure */ + return JAR_ERR_PK7; } + SEC_PKCS7DecoderUpdate (dcx, data, length); + cinfo = SEC_PKCS7DecoderFinish (dcx); + if (cinfo == NULL) { /* strange pkcs7 failure */