RFR: 8277299: STACK_OVERFLOW in Java_sun_awt_shell_Win32ShellFolder2_getIconBits [v2]
Alexey Ivanov
aivanov at openjdk.java.net
Mon Nov 22 19:16:09 UTC 2021
On Sat, 20 Nov 2021 05:03:46 GMT, Alexander Zuev <kizune at 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
More information about the client-libs-dev
mailing list