[PR] Use unsigned element count when parsing EscherArrayProper ty [poi]

jmestwa-coder (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.poi.devel
Message-ID <[email protected]>
jmestwa-coder opened a new pull request, #1116:
URL: https://github.com/apache/poi/pull/1116

   ## Summary
   
   Use an unsigned element count when parsing `EscherArrayProperty`.
   
   ## Changes
   
   * Replace `LittleEndian.getShort()` with `LittleEndian.getUShort()` when reading the array element count (`nElems`) in `EscherArrayProperty#setArrayData`.
   * Align parsing behavior with the existing unsigned accessors in the same class.
   * Ensure values in the full unsigned range (`0-65535`) are interpreted correctly.
   
   ## Why
   
   * The element count field is treated as unsigned elsewhere in `EscherArrayProperty`.
   * Reading the field as a signed value can misinterpret counts greater than `32767`.
   * This creates inconsistent behavior between parsing and subsequent access to the property data.
   
   ## Tests
   
   * Added a regression test covering an element count larger than `32767`.
   * Verified that the parsed complex data size is calculated correctly using the unsigned value.


-- 
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.