[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8277299: STACK_OVERFLOW in Java_sun_awt_shell_Win32ShellFolder2_getIconBits [v2]
From:       Alexey Ivanov <aivanov () openjdk ! java ! net>
Date:       2021-11-22 19:16:09
Message-ID: MQgleFlF0fjC7LpAsyLD7g-ok0uCqyGSihb3t-E8ybo=.7e85045f-e327-45f7-8634-ae88edf0df4f () github ! com
[Download RAW message or body]

On Sat, 20 Nov 2021 05:03:46 GMT, Alexander Zuev <kizune@openjdk.org> wrote:

> > Made colorBits and maskBits arrays dynamic so they are allocated on heap instead \
> > of stack. Added regression test.
> 
> Alexander Zuev has updated the pull request incrementally with one additional \
> commit since the last revision: 
> Added bad_malloc handling
> Fixed insets
> Declaration and assignment are now joined

src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp line 1097:

> 1095:             free(colorBits);
> 1096: 
> 1097:             CATCH_BAD_ALLOC_RET(NULL);

I believe we leak `dc` as well as `iconInfo.hbmColor` and `iconInfo.hbmMask` if \
`std::bad_alloc` is thrown.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6473


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic