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 */