This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git

The following commit(s) were added to refs/heads/master by this push:
       new  b8fd7ee   TIKA-2285 -- triggering document did not trigger an 
string out of bounds exception, but a corrupt/very short stylename could.
b8fd7ee is described below

commit b8fd7ee82a1ffeb7e41358bfaa7c5d003e6c255c
Author: tballison <[email protected]>
AuthorDate: Wed Mar 1 09:48:02 2017 -0500

    TIKA-2285 -- triggering document did not trigger an string out of bounds 
exception, but a corrupt/very short stylename could.
---
 .../main/java/org/apache/tika/parser/microsoft/WordExtractor.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/WordExtractor.java
 
b/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/WordExtractor.java
index 8096d8c..afce4ee 100644
--- 
a/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/WordExtractor.java
+++ 
b/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/WordExtractor.java
@@ -108,6 +108,11 @@ public class WordExtractor extends AbstractPOIFSExtractor {
      * what style should be applied to it.
      */
     public static TagAndStyle buildParagraphTagAndStyle(String styleName, 
boolean isTable) {
+
+        if (styleName == null || styleName.trim().length() < 2) {
+            return defaultParagraphStyle;
+        }
+
         TagAndStyle tagAndStyle = fixedParagraphStyles.get(styleName);
         if (tagAndStyle != null) {
             return tagAndStyle;

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to