diff options
author | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-11-12 15:40:19 +0000 |
---|---|---|
committer | tknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-11-12 15:40:19 +0000 |
commit | 7b883e536a32606dd9d940479634a8d0055d1e57 (patch) | |
tree | 2dc9075fef8cf6eb143e55aa775135fb1ddfd22f /src/main/java/at/knowcenter/wag | |
parent | 8d286ec651c5252192c3634f9e34f91d929ef721 (diff) | |
download | pdf-as-3-7b883e536a32606dd9d940479634a8d0055d1e57.tar.gz pdf-as-3-7b883e536a32606dd9d940479634a8d0055d1e57.tar.bz2 pdf-as-3-7b883e536a32606dd9d940479634a8d0055d1e57.zip |
fatal bug fixed (parsing for signed-data-object-ids)
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@223 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag')
-rw-r--r-- | src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java index 5e3033e..8f0b79e 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/bku/BKUHelper.java @@ -341,14 +341,21 @@ public final class BKUHelper private static String extractId(String text, String name)
{
String id = null;
- int start_idx = text.indexOf(name) + name.length();
+ // fatal bug; fixed by tknall (start)
+ int startOfName = text.indexOf(name);
+ if (startOfName == -1) {
+ log.debug("No id for name \"" + name + "\" extracted. Probably detached signature. Returning empty id: \"\""); //$NON-NLS-1$
+ return "";
+ }
+ // stop
+
+ int start_idx = startOfName + name.length();
int end_idx = text.indexOf("\"", start_idx); //$NON-NLS-1$
final int quot_end_idx = end_idx;
final int squot_end_idx = text.indexOf("'", start_idx); //$NON-NLS-1$
end_idx = Math.min(quot_end_idx, squot_end_idx);
id = text.substring(start_idx, end_idx);
- log.info("extract id:" + name + id); //$NON-NLS-1$
if (log.isDebugEnabled())
{
log.debug("extract id:" + name + id); //$NON-NLS-1$
|