RFR: 8277299: STACK_OVERFLOW in Java_sun_awt_shell_Win32ShellFolder2_getIconBits [v2]

Alexander Zuev kizune at openjdk.java.net
Thu Dec 2 22:05:05 UTC 2021


On Mon, 22 Nov 2021 19:13:11 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

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

Fixed. Now we will release these resources on exit in case of bad_alloc.

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

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



More information about the client-libs-dev mailing list