pjfanning opened a new pull request, #1497:
URL: https://github.com/apache/poi/pull/1497

   Follow-up to #1496, addressing the review points on it.
   
   - **VBAMacroReader, dir read after module**: when a module stream is read 
before the dir stream that holds its offset (the bug 59858 layout), a bad 
offset now falls back to the brute-force search, as 
`readModuleFromDocumentStream` already does. If that search finds nothing, the 
original exception is rethrown.
   - **VBAMacroReader, corrupt dir stream**: an `IllegalArgumentException` or 
`IllegalStateException` from decompressing the dir stream is now wrapped in the 
existing "Error occurred while reading macros at section id ..." `IOException`, 
like other dir errors. This also covers the reader's own "Unexpected reserved 
character" `IllegalArgumentException`.
   - **No stale bytes after a failed chunk**: `readChunk` resets `len` before 
decoding, so after an exception `read`, `read(byte[])`, `skip` and `available` 
report end of stream instead of returning bytes from the previous chunk.
   - **Truncated input**: input that ends inside a literal or a copy token now 
keeps the bytes already decompressed in that chunk, as input that ends at a 
flag byte already did. Before, those bytes were dropped.
   - **Uncompressed chunks**: MS-OVBA requires a raw chunk to hold exactly 4096 
bytes. Shorter raw chunks are now rejected.
   - **Tests**: `emptyChunkDoesNotRepeatBytes` now checks that reading carries 
on past the empty chunk, `literalPastChunkEnd` uses a single 
`assertArrayEquals`, and there are new tests for each change above. All five 
new behavioural tests fail without the source changes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to