summaryrefslogtreecommitdiffstats
path: root/base/util
diff options
context:
space:
mode:
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();
+
}
/**