]> source.dussan.org Git - poi.git/commitdiff
If there's no more data but there ought to be for unicode strings, in a partly corrup...
authorNick Burch <nick@apache.org>
Tue, 19 Jan 2010 12:03:27 +0000 (12:03 +0000)
committerNick Burch <nick@apache.org>
Tue, 19 Jan 2010 12:03:27 +0000 (12:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@900745 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/SSTDeserializer.java

index 660ad0e95a300794633c70ef6054afd1cbf15f41..280bc26c9fc7ebdd599ff75edefc74b1196c6079 100644 (file)
@@ -47,7 +47,13 @@ class SSTDeserializer
     {
       for (int i=0;i<stringCount;i++) {
          // Extract exactly the count of strings from the SST record.
-         UnicodeString str = new UnicodeString(in);
+         UnicodeString str;
+         if(in.available() == 0 && ! in.hasNextRecord()) {
+            System.err.println("Ran out of data before creating all the strings! String at index " + i + "");
+            str = new UnicodeString("");
+         } else {
+            str = new UnicodeString(in);
+         }
          addToStringTable( strings, str );
       }
     }