RFR: 8365609: Fix several potential NULL native pointer dereferences in the desktop module [v4]
Phil Race
prr at openjdk.org
Fri Aug 29 16:08:45 UTC 2025
On Fri, 29 Aug 2025 08:11:19 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Artem Semenov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fixed indentation
>
> src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c line 286:
>
>> 284: transparentColor < 0) {
>> 285: fillColor= MAKE_QUAD_GIF(
>> 286: colorMap->Colors[gif->SBackGroundColor], 0xff);
>
> Dont we need to check for colorMap->Colors here too
>
> https://github.com/openjdk/jdk/blob/c96d09acd95d0ccf2fef50b8ccfeb5e2a0aa0968/src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c#L208
The problem isn't the Colors member, it is colorMap. I'm not sure the new check for Colors is necessary.
If you look at giflib's allocator for this it will never return a colorMap without Colors allocated and the giflib code itself assumes that this is true.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26799#discussion_r2310550500
More information about the client-libs-dev
mailing list