From aed42a16bacb24753a536d07fedd736d64cde3be Mon Sep 17 00:00:00 2001 From: Artem Semenov Date: Thu, 16 Oct 2025 07:28:13 +0000 Subject: [PATCH] 8365609: Fix several potential NULL native pointer dereferences in the desktop module Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Artem Semenov Artem Semenov Reviewed-by: azvegint, prr, serb --- .../share/native/libsplashscreen/splashscreen_gif.c | 4 +++- .../unix/native/libawt_xawt/awt/gtk3_interface.c | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c b/src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c index cbdad61f78e..4f2cfca8dd0 100644 --- a/src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c +++ b/src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c @@ -279,7 +279,9 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) ImageRect dstRect; rgbquad_t fillColor = 0; // 0 is transparent - if (transparentColor < 0) { + if (colorMap && + colorMap->Colors && + transparentColor < 0) { fillColor= MAKE_QUAD_GIF( colorMap->Colors[gif->SBackGroundColor], 0xff); } diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c index 916880873c6..e5b2dfa6db9 100644 --- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c +++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c @@ -276,10 +276,7 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name) fp_gtk_check_version = dl_symbol("gtk_check_version"); /* GLib */ - fp_glib_check_version = dlsym(gtk3_libhandle, "glib_check_version"); - if (!fp_glib_check_version) { - dlerror(); - } + fp_glib_check_version = dl_symbol("glib_check_version"); fp_g_free = dl_symbol("g_free"); fp_g_object_unref = dl_symbol("g_object_unref");