https://bz.apache.org/bugzilla/show_bug.cgi?id=61337

            Bug ID: 61337
           Summary: Downgrade AssertionError to RuntimeException or
                    something better
           Product: POI
           Version: 3.17-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HWPF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 35171
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35171&action=edit
triggering file

A fuzzed version of testException2.doc in Tika's test corpus triggers:

Caused by: java.lang.AssertionError
        at org.apache.poi.hwpf.usermodel.Range.sanityCheck(Range.java:1158)
        at org.apache.poi.hwpf.usermodel.Range.<init>(Range.java:195)
        at
org.apache.poi.hwpf.usermodel.HeaderStories.getSubrangeAt(HeaderStories.java:357)
        at
org.apache.poi.hwpf.usermodel.HeaderStories.getOddHeaderSubrange(HeaderStories.java:196)
        at
org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:180)
        at
org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:175)
        at
org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:131)
        at
org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
        at
org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
        at
org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:135)

We should definitely have a range check, but I think it would be better to
throw a RecordFormatException or RuntimeException?

More generally, there is room to make our "broken record" exception handling
more consistent.  My preference would be to throw RecordFormatException for
this kind of thing.

Other ideas?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to