pjfanning opened a new pull request, #1551: URL: https://github.com/apache/poi/pull/1551
Fixes #1545 The `Property(int, byte[], int)` constructor works out the name length from the 2-byte name size field and only checked that it wasn't below 1. The name field is 64 bytes, so it holds at most 31 characters plus the terminator. A name size of up to 0x7FFF made the read loop run past the 128-byte `_raw_data` and throw `ArrayIndexOutOfBoundsException`. The length is now capped at `_max_name_length` (31), the same limit `setName()` uses. I chose capping over throwing because this constructor doesn't declare `IOException`, and capping still reads files whose name size is only slightly off. Added `TestDocumentProperty.testNameSizeTooLarge`. It fails with the reported exception without the fix. 🤖 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]
