From f7d84407b9ed60925527b2d1b5caa0aba1d60d75 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 28 Oct 2025 02:35:33 +0000 Subject: [PATCH] Add null pointer security checks and fixed the possible crash issue when destroying ImlibLoader (cherry picked from commit 98ef0544f87a762a0ca5454eadb99c3e1e932b57) --- fix-openbox-imlib-free-image-NULL.patch | 26 +++++++++++++++++++++++++ openbox.spec | 8 ++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 fix-openbox-imlib-free-image-NULL.patch diff --git a/fix-openbox-imlib-free-image-NULL.patch b/fix-openbox-imlib-free-image-NULL.patch new file mode 100644 index 0000000..bbb40e2 --- /dev/null +++ b/fix-openbox-imlib-free-image-NULL.patch @@ -0,0 +1,26 @@ +From c776d4df4a90f7099d132b9a8465fbc4205e7337 Mon Sep 17 00:00:00 2001 +From: andy +Date: Tue, 28 Oct 2025 09:54:40 +0800 +Subject: [PATCH] fix-openbox-imlib-free-image-NULL + +--- + obrender/image.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/obrender/image.c b/obrender/image.c +index cffbaf3..5c689c4 100644 +--- a/obrender/image.c ++++ b/obrender/image.c +@@ -481,7 +481,8 @@ void DestroyImlibLoader(ImlibLoader *loader) + if (!loader) + return; + +- imlib_free_image(); ++ if (loader->img) ++ imlib_free_image(); + g_slice_free(ImlibLoader, loader); + } + +-- +2.25.1 + diff --git a/openbox.spec b/openbox.spec index 1ffa11f..f06d6a0 100644 --- a/openbox.spec +++ b/openbox.spec @@ -1,6 +1,6 @@ Name: openbox Version: 3.6.1 -Release: 14 +Release: 15 Summary: Windowmanager based on the original blackbox-code License: GPLv2+ URL: http://openbox.org @@ -10,7 +10,8 @@ Source2: xdg-menu Source3: menu.xml Source4: terminals.menu #switch packaged python scrpits to python3 -Patch0001: openbox-python3.patch +Patch0001: openbox-python3.patch +Patch0002: fix-openbox-imlib-free-image-NULL.patch Suggests: python3-gobject BuildRequires: gettext desktop-file-utils pango-devel startup-notification-devel libxml2-devel @@ -121,6 +122,9 @@ install -m644 -D data/gnome-session/openbox-gnome-fallback.session \ %{_mandir}/man1/* %changelog +* Tue Oct 28 2025 andy - 3.6.1-15 +- fix openbox imlib free image NULL + * Tue Jun 20 2023 yoo - 3.6.1-14 - fix clang build error -- Gitee