Browse Source

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
tags/fop-0_94
Jeremias Maerki 17 years ago
parent
commit
650ab02c56
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/java/org/apache/fop/area/Trait.java

+ 2
- 1
src/java/org/apache/fop/area/Trait.java View File

@@ -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

Loading…
Cancel
Save