jmestwa-coder opened a new pull request, #1117:
URL: https://github.com/apache/poi/pull/1117

   ### Summary
   
   Validate the `EMR_EXTCREATEPEN` style entry count before allocating the dash 
pattern array.
   
   ### Changes
   
   * Add `HemfPicture.safelyAllocateCheck(numStyleEntries)` before allocating 
the dash pattern array.
   * Reuse the existing HEMF allocation validation mechanism already used in 
related parser paths.
   * Reject oversized style entry counts before attempting memory allocation.
   
   ### Why
   
   * `numStyleEntries` is read from EMF input and directly controls array 
allocation size.
   * A malformed record can request an excessively large allocation, leading to 
resource exhaustion or allocation failures.
   * This change ensures allocation limits are enforced consistently across 
HEMF record parsers.
   
   ### Impact
   
   * No behavior change for valid EMF files.
   * Oversized or malformed inputs now fail through the existing validation 
path instead of attempting allocation.
   * Aligns `EMR_EXTCREATEPEN` with the recent HEMF allocation-hardening 
updates.


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