Created attachment 36092 [details] triggering document New exception in 4.0.0-SNAPSHOT. Caused by: java.io.IOException: Expected 3eafter name before Unicode name, but found: d at org.apache.poi.poifs.macros.VBAMacroReader.readStringPair(VBAMacroReader.java:555) at org.apache.poi.poifs.macros.VBAMacroReader.processDirStream(VBAMacroReader.java:488)
See decalage's note: https://github.com/decalage2/oletools/blob/master/oletools/olevba.py#L1516 # According to [MS-OVBA] 2.3.4.2.2.2 REFERENCENAME Record: # "Reserved (2 bytes): MUST be 0x003E. MUST be ignored." # So let's ignore it, otherwise it crashes on some files (issue #132) # PR #135 by @c1fe: # contrary to the specification I think that the unicode name # is optional. if reference_reserved is not 0x003E I think it # is actually the start of another REFERENCE record # at least when projectsyskind_syskind == 0x02 (Macintosh) Sometimes REFERENCENAME only has an ascii part, contrary to the spec.
r1845238
To clarify, this wasn't a regression. This was a bug that became apparent with better exception handling.
The recent code changes seem to have introduced a number of new warnings in https://lgtm.com/projects/g/apache/poi/alerts/?mode=list and in FindBugs output (see the spike in https://builds.apache.org/view/P/view/POI/job/POI-DSL-1.8/)
Doh. Fixing now. Thank you.
One dodgy loop fixed. Added other sanity checks. Thank you, PJ!
And fix made to ensure closing of streams from lgtm. Thank you, again, PJ.