[PR] Apply allocation bounds checks to EmfPolyDraw and WmfCrea teRegion [poi]

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

   EmfPolyDraw and WmfCreateRegion allocate arrays directly from count fields read from the input stream.
   
   This change applies POI's existing allocation safety checks before the following count-driven allocations:
   
   Point arrays in EmfPolyDraw
   Scan object arrays in WmfCreateRegion
   
   Invalid, excessively large, or negative counts are now rejected through POI's standard allocation validation path instead of attempting unchecked array allocations.
   
   Tests
   
   Added regression tests covering:
   
   Integer.MAX_VALUE count in EmfPolyDraw
   Negative count in WmfCreateRegion
   
   These tests verify that malformed inputs are rejected before array allocation occurs.
   
   Executed the automated unit tests:
   
   ./gradlew :poi-scratchpad:test -PjdkVersion=17


-- 
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.