summaryrefslogtreecommitdiffstats
path: root/base/java-tools
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-06-06 16:55:54 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-06-14 17:14:19 -0500
commitc53ca291e21761f1de5417ef596afba395a7f5d1 (patch)
tree47a0cd8ecd9d36d414d9230282704e9f784d0a71 /base/java-tools
parent084a8cd360c7508febde06415d727d7d247b16ad (diff)
downloadpki-c53ca291e21761f1de5417ef596afba395a7f5d1.tar.gz
pki-c53ca291e21761f1de5417ef596afba395a7f5d1.tar.xz
pki-c53ca291e21761f1de5417ef596afba395a7f5d1.zip
Fixes for NULL_RETURNS Coverity Issues - Part 2
Diffstat (limited to 'base/java-tools')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/DRMTool.java4
-rw-r--r--base/java-tools/src/com/netscape/cmstools/OCSPClient.java3
-rw-r--r--base/java-tools/src/com/netscape/cmstools/PKCS12Export.java6
3 files changed, 12 insertions, 1 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/DRMTool.java b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
index efd83e892..0eaf26ee1 100644
--- a/base/java-tools/src/com/netscape/cmstools/DRMTool.java
+++ b/base/java-tools/src/com/netscape/cmstools/DRMTool.java
@@ -1642,7 +1642,9 @@ public class DRMTool {
new FileReader(
mSourcePKISecurityDatabasePwdfile));
pwd = in.readLine();
-
+ if (pwd == null) {
+ pwd = "";
+ }
mPwd = new Password(pwd.toCharArray());
mSourceToken.login(mPwd);
diff --git a/base/java-tools/src/com/netscape/cmstools/OCSPClient.java b/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
index fc2f081e9..7d581fdb8 100644
--- a/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
+++ b/base/java-tools/src/com/netscape/cmstools/OCSPClient.java
@@ -174,6 +174,9 @@ public class OCSPClient {
ResponseData rd = basic.getResponseData();
for (int i = 0; i < rd.getResponseCount(); i++) {
SingleResponse rd1 = rd.getResponseAt(i);
+ if (rd1 == null) {
+ throw new Exception("No OCSP Response data.");
+ }
System.out.println("CertID.serialNumber=" +
rd1.getCertID().getSerialNumber());
CertStatus status1 = rd1.getCertStatus();
diff --git a/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java b/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
index ad1c485c0..532505867 100644
--- a/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
+++ b/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
@@ -224,6 +224,9 @@ public class PKCS12Export {
try {
BufferedReader in = new BufferedReader(new FileReader(pwdfile));
pwd = in.readLine();
+ if (pwd == null) {
+ pwd = "";
+ }
} catch (Exception e) {
debug("Failed to read the keydb password from the file. Exception: " + e.toString());
System.exit(1);
@@ -233,6 +236,9 @@ public class PKCS12Export {
try {
BufferedReader in = new BufferedReader(new FileReader(pk12pwdfile));
pk12pwd = in.readLine();
+ if (pk12pwd == null) {
+ pk12pwd = "";
+ }
} catch (Exception e) {
debug("Failed to read the keydb password from the file. Exception: " + e.toString());
System.exit(1);