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

   Fixes #1546
   
   `MAPIAttribute.create()` read the name length `mplen` of a custom-named MAPI 
property and computed `(mplen/2)-1` without checking it. For `mplen` of 0 or 1 
that gives -1, and `StringUtil.getFromUnicodeLE` threw an unchecked 
`ArrayIndexOutOfBoundsException` or `IllegalArgumentException`.
   
   The name must hold at least the 2-byte UTF-16 null terminator, so a length 
below 2 now throws an `IOException`.
   
   Added a parameterized test in `TestMAPIAttributes` for lengths -1, 0 and 1.
   
   🤖 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