From 5c7eb1c5334b144914a4da03b645f961dbf889dc Mon Sep 17 00:00:00 2001 From: juh Date: Tue, 22 Oct 2013 11:57:38 -0700 Subject: [PATCH] 8025287: NPE in api/java_security/cert/PKIXRevocationChecker/GeneralTests_GeneralTests Reviewed-by: mullan --- .../sun/security/provider/certpath/RevocationChecker.java | 2 +- test/java/security/cert/PKIXRevocationChecker/UnitTest.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/share/classes/sun/security/provider/certpath/RevocationChecker.java b/src/share/classes/sun/security/provider/certpath/RevocationChecker.java index 0aad090a8..f34e73710 100644 --- a/src/share/classes/sun/security/provider/certpath/RevocationChecker.java +++ b/src/share/classes/sun/security/provider/certpath/RevocationChecker.java @@ -307,7 +307,7 @@ class RevocationChecker extends PKIXRevocationChecker { : anchor.getCAPublicKey(); } crlSignFlag = true; - if (params.certPath() != null) { + if (params != null && params.certPath() != null) { certIndex = params.certPath().getCertificates().size() - 1; } else { certIndex = -1; diff --git a/test/java/security/cert/PKIXRevocationChecker/UnitTest.java b/test/java/security/cert/PKIXRevocationChecker/UnitTest.java index 5c5f5bcfc..8ddfda242 100644 --- a/test/java/security/cert/PKIXRevocationChecker/UnitTest.java +++ b/test/java/security/cert/PKIXRevocationChecker/UnitTest.java @@ -23,7 +23,7 @@ /** * @test - * @bug 6854712 7171570 8010748 + * @bug 6854712 7171570 8010748 8025287 * @summary Basic unit test for PKIXRevocationChecker */ @@ -44,6 +44,8 @@ public class UnitTest { CertPathChecker cpc = cpv.getRevocationChecker(); PKIXRevocationChecker prc = (PKIXRevocationChecker)cpc; + prc.init(false); + System.out.println("Testing that get methods return null or " + "empty lists/sets/maps"); requireNull(prc.getOcspResponder(), "getOcspResponder()"); -- GitLab