diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-05-21 06:17:48 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-05-21 06:17:48 +0000 |
commit | 650ab02c56cf4af0ce2bfbc3656fbfb6cae6c55e (patch) | |
tree | 3a3939e5383554081dee473bc08c5985cef8f8a4 | |
parent | 34f930d783debd1f7f1f94e6b06e5d974dac57f3 (diff) | |
download | xmlgraphics-fop-650ab02c56cf4af0ce2bfbc3656fbfb6cae6c55e.tar.gz xmlgraphics-fop-650ab02c56cf4af0ce2bfbc3656fbfb6cae6c55e.zip |
Bugzilla #42067:
Fixed a possible StringIndexOutOfBoundsException.
Submitted by: Paul Vinkenoog <paul.at.vinkenoog.nl>
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@540036 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/Trait.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/area/Trait.java b/src/java/org/apache/fop/area/Trait.java index 32582dec1..fb7065e77 100644 --- a/src/java/org/apache/fop/area/Trait.java +++ b/src/java/org/apache/fop/area/Trait.java @@ -520,7 +520,8 @@ public class Trait implements Serializable { String[] result = {null, null}; if (attrValue != null) { int len = attrValue.length(); - if (len >= 2 && attrValue.charAt(0) == '(' && attrValue.charAt(len - 1) == ')') { + if (len >= 2 && attrValue.charAt(0) == '(' && attrValue.charAt(len - 1) == ')' + && attrValue.indexOf(',') != -1) { String value = attrValue.substring(1, len - 1); // remove brackets int delimIndex = value.indexOf(','); result[0] = value.substring(0, delimIndex).trim(); // PV key |