[OpenJDK 2D-Dev] <AWT Dev> RFR(S): 8161923: Fix two memory issues.

Vadim Pakhnushev vadim.pakhnushev at oracle.com
Wed Jul 20 15:36:28 UTC 2016


Hi Goetz,

Maybe instead of increasing the stack size we could move the increment 
from the assignment to the previous if statement where we check for the 
overwrite possibility?
There are similar code patterns in this file.
Also there is almost identical file LigatureSubstProc.cpp which also 
contains similar code.

Thanks,
Vadim

On 20.07.2016 16:13, Lindenmaier, Goetz wrote:
>
> Hi
>
> This changes fixes two memory issues.
>
> In awt_PrintControl.cpp, a wrong pointer is freed.
>
> In LigatureSubstProc2.cpp, line 157:
>
>     stack[++mm] = componentGlyph;
>
> can overwrite the stack by one element. It will write
>
> stack[nComponents], because ++mm increments before
>
> accessing the array.
>
> Fix: increase the size of the array by one.
>
> Please review this change:
>
> http://cr.openjdk.java.net/~goetz/wr16/8161923-jdkMem/webrev.01/ 
> <http://cr.openjdk.java.net/%7Egoetz/wr16/8161923-jdkMem/webrev.01/>
>
> Best regards,
>
>   Goetz.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160720/aab3f742/attachment.html>


More information about the 2d-dev mailing list