Re: [PR] apply allocation bounds check to EmfExtCreatePen st yle entries [poi]

metsw24-max (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.poi.devel
Message-ID <PR_kwDOAAMmIM7ikTM6-3f63a622-bd46-40a8-abef-432a4707e894@gitbox.apache.org>
metsw24-max commented on code in PR #1113:
URL: https://github.com/apache/poi/pull/1113#discussion_r3356020482


##########
poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emf/HemfMisc.java:
##########
@@ -624,6 +626,7 @@ public long init(LittleEndianInputStream leis, long recordSize, long recordId) t
             // If the pen type in the PenStyle field is PS_GEOMETRIC, the lengths are specified in logical
             // units; otherwise, the lengths are specified in device units.
 
+            IOUtils.safelyAllocateCheck(numStyleEntries, HwmfPicture.getMaxRecordLength());

Review Comment:
   good catch, that was reaching into the hwmf limit by mistake. now that #1114 has landed the hemf-specific limit i've rebased and switched this to HemfPicture.safelyAllocateCheck, same as the polyline decoder in HemfDraw.



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