summaryrefslogtreecommitdiffstats
path: root/base/util
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-05-31 17:04:47 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-06-05 14:46:04 -0500
commitc2128339ba046ceb7ab32954ae07dbb4b41d4e73 (patch)
tree78b83b2992faa71ad57e83d60b25dda1470c4a0b /base/util
parent500fe4441a5d458818138cc9b536c3b19ac23dc8 (diff)
downloadpki-c2128339ba046ceb7ab32954ae07dbb4b41d4e73.tar.gz
pki-c2128339ba046ceb7ab32954ae07dbb4b41d4e73.tar.xz
pki-c2128339ba046ceb7ab32954ae07dbb4b41d4e73.zip
Fixes for Null_Returns Cases - 1 For Commit
Diffstat (limited to 'base/util')
-rw-r--r--base/util/src/com/netscape/cmsutil/http/HttpMessage.java6
-rw-r--r--base/util/src/netscape/security/util/PrettyPrintFormat.java3
-rw-r--r--base/util/src/netscape/security/x509/KeyUsageExtension.java7
3 files changed, 12 insertions, 4 deletions
diff --git a/base/util/src/com/netscape/cmsutil/http/HttpMessage.java b/base/util/src/com/netscape/cmsutil/http/HttpMessage.java
index 398f38400..44f608900 100644
--- a/base/util/src/com/netscape/cmsutil/http/HttpMessage.java
+++ b/base/util/src/com/netscape/cmsutil/http/HttpMessage.java
@@ -119,9 +119,9 @@ public class HttpMessage {
throws IOException {
String line = reader.readLine();
- // if (line == null) {
- // throw new HttpEofException("End of stream reached");
- // }
+ if (line == null) {
+ throw new HttpEofException("End of stream reached");
+ }
if (line.equals("")) {
throw new HttpProtocolException("Bad Http req/resp line " + line);
}
diff --git a/base/util/src/netscape/security/util/PrettyPrintFormat.java b/base/util/src/netscape/security/util/PrettyPrintFormat.java
index 4bbc87936..30ae33b10 100644
--- a/base/util/src/netscape/security/util/PrettyPrintFormat.java
+++ b/base/util/src/netscape/security/util/PrettyPrintFormat.java
@@ -102,6 +102,9 @@ public class PrettyPrintFormat {
public String toHexString(byte[] in, int indentSize,
int lineLen, String separator) {
+ if (in == null) {
+ return "";
+ }
StringBuffer sb = new StringBuffer();
int hexCount = 0;
char c[];
diff --git a/base/util/src/netscape/security/x509/KeyUsageExtension.java b/base/util/src/netscape/security/x509/KeyUsageExtension.java
index 15bf29b83..8cbfc880a 100644
--- a/base/util/src/netscape/security/x509/KeyUsageExtension.java
+++ b/base/util/src/netscape/security/x509/KeyUsageExtension.java
@@ -210,7 +210,12 @@ public class KeyUsageExtension extends Extension
}
this.extensionValue = extValue;
DerValue val = new DerValue(extValue);
- this.bitString = val.getUnalignedBitString().toBooleanArray();
+ BitArray bitArray = val.getUnalignedBitString();
+ if (bitArray == null) {
+ throw new IOException("Invalid bit string");
+ }
+ this.bitString = bitArray.toBooleanArray();
+
}
/**