From 650ab02c56cf4af0ce2bfbc3656fbfb6cae6c55e Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 21 May 2007 06:17:48 +0000 Subject: Bugzilla #42067: Fixed a possible StringIndexOutOfBoundsException. Submitted by: Paul Vinkenoog git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@540036 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/Trait.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/java/org/apache/fop/area') 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 -- cgit v1.2.3