diff --git a/src/java/org/apache/poi/hpsf/Property.java b/src/java/org/apache/poi/hpsf/Property.java index 2b04da852..ee99468e2 100644 --- a/src/java/org/apache/poi/hpsf/Property.java +++ b/src/java/org/apache/poi/hpsf/Property.java @@ -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 index 000000000..a7962b369 Binary files /dev/null and b/src/testcases/org/apache/poi/hpsf/data/TestSolidWorks.sldprt differ