]> source.dussan.org Git - poi.git/commitdiff
Buf fix plus testcasde: Reading property values failed with a StringIndexOutOfBoundsE...
authorRainer Klute <klute@apache.org>
Thu, 8 Jan 2004 14:25:35 +0000 (14:25 +0000)
committerRainer Klute <klute@apache.org>
Thu, 8 Jan 2004 14:25:35 +0000 (14:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353485 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hpsf/Property.java
src/testcases/org/apache/poi/hpsf/data/TestSolidWorks.sldprt [new file with mode: 0644]

index 2b04da8528f6eae092d338cc4796240bf0d90183..ee99468e2caca93010ef484afe11ff8916152d45 100644 (file)
@@ -265,7 +265,7 @@ public class Property
                     b.append((char) src[o + j]);
 
             /* Strip 0x00 characters from the end of the string: */
-            while (b.charAt(b.length() - 1) == 0x00)
+            while (b.length() > 0 && b.charAt(b.length() - 1) == 0x00)
                 b.setLength(b.length() - 1);
             if (codepage == CP_UNICODE)
             {
diff --git a/src/testcases/org/apache/poi/hpsf/data/TestSolidWorks.sldprt b/src/testcases/org/apache/poi/hpsf/data/TestSolidWorks.sldprt
new file mode 100644 (file)
index 0000000..a7962b3
Binary files /dev/null and b/src/testcases/org/apache/poi/hpsf/data/TestSolidWorks.sldprt differ