summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/common/src/com/netscape/cms/servlet/cert/GetCRL.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java b/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
index a5a48cc..9bfbc86 100644
--- a/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
+++ b/base/common/src/com/netscape/cms/servlet/cert/GetCRL.java
@@ -343,25 +343,26 @@ public class GetCRL extends CMSServlet {
while (i < length) {
int k = crlBase64Encoded.indexOf('\n', i);
+ if (k < 0)
+ break;
- if (n < 100 && k > -1) {
+ if (n < 100) {
n++;
i = k + 1;
} else {
n = 1;
IArgBlock rarg = CMS.createArgBlock();
-
- if (k > -1) {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
- i = k + 1;
- j = i;
- } else {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
- i = length;
- }
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
+ i = k + 1;
+ j = i;
argSet.addRepeatRecord(rarg);
}
}
+ if (j < length) {
+ IArgBlock rarg = CMS.createArgBlock();
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
+ argSet.addRepeatRecord(rarg);
+ }
} catch (CRLException e) {
}
} else if (crlDisplayType.equals("deltaCRL")) {
@@ -383,25 +384,25 @@ public class GetCRL extends CMSServlet {
while (i < length) {
int k = crlBase64Encoded.indexOf('\n', i);
-
- if (n < 100 && k > -1) {
+ if (k < 0)
+ break;
+ if (n < 100) {
n++;
i = k + 1;
} else {
n = 1;
IArgBlock rarg = CMS.createArgBlock();
-
- if (k > -1) {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
- i = k + 1;
- j = i;
- } else {
- rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
- i = length;
- }
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, k));
+ i = k + 1;
+ j = i;
argSet.addRepeatRecord(rarg);
}
}
+ if (j < length) {
+ IArgBlock rarg = CMS.createArgBlock();
+ rarg.addStringValue("crlBase64Encoded", crlBase64Encoded.substring(j, length));
+ argSet.addRepeatRecord(rarg);
+ }
} catch (CRLException e) {
}
}