diff --git a/package/libfreeglut/0001-Plug-memory-leak-that-happens-upon-error.patch b/package/libfreeglut/0001-Plug-memory-leak-that-happens-upon-error.patch deleted file mode 100644 index d09e9befb3..0000000000 --- a/package/libfreeglut/0001-Plug-memory-leak-that-happens-upon-error.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 9ad320c1ad1a25558998ddfe47674511567fec57 Mon Sep 17 00:00:00 2001 -From: Sebastian Rasmussen -Date: Mon, 12 Feb 2024 14:46:22 +0800 -Subject: [PATCH] Plug memory leak that happens upon error. - -If fgStructure.CurrentMenu is set when glutAddMenuEntry() or -glutAddSubMenu() is called the allocated menuEntry variable will -leak. This commit postpones allocating menuEntry until after the -error checks, thereby plugging the memory leak. - -This fixes CVE-2024-24258 and CVE-2024-24259. -Upstream: https://github.com/freeglut/freeglut/commit/9ad320c1ad1a25558998ddfe47674511567fec57 -Signed-off-by: Raphaël Mélotte ---- - src/fg_menu.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/fg_menu.c b/src/fg_menu.c -index 53112dc2..0da88901 100644 ---- a/src/fg_menu.c -+++ b/src/fg_menu.c -@@ -864,12 +864,12 @@ void FGAPIENTRY glutAddMenuEntry( const char* label, int value ) - { - SFG_MenuEntry* menuEntry; - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutAddMenuEntry" ); -- menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 ); - - freeglut_return_if_fail( fgStructure.CurrentMenu ); - if (fgState.ActiveMenus) - fgError("Menu manipulation not allowed while menus in use."); - -+ menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 ); - menuEntry->Text = strdup( label ); - menuEntry->ID = value; - -@@ -888,7 +888,6 @@ void FGAPIENTRY glutAddSubMenu( const char *label, int subMenuID ) - SFG_Menu *subMenu; - - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutAddSubMenu" ); -- menuEntry = ( SFG_MenuEntry * )calloc( sizeof( SFG_MenuEntry ), 1 ); - subMenu = fgMenuByID( subMenuID ); - - freeglut_return_if_fail( fgStructure.CurrentMenu ); -@@ -897,6 +896,7 @@ void FGAPIENTRY glutAddSubMenu( const char *label, int subMenuID ) - - freeglut_return_if_fail( subMenu ); - -+ menuEntry = ( SFG_MenuEntry * )calloc( sizeof( SFG_MenuEntry ), 1 ); - menuEntry->Text = strdup( label ); - menuEntry->SubMenu = subMenu; - menuEntry->ID = -1; --- -2.48.1 - diff --git a/package/libfreeglut/0002-egl-fix-fgPlatformDestroyContext-prototype-for-C23.patch b/package/libfreeglut/0001-egl-fix-fgPlatformDestroyContext-prototype-for-C23.patch similarity index 100% rename from package/libfreeglut/0002-egl-fix-fgPlatformDestroyContext-prototype-for-C23.patch rename to package/libfreeglut/0001-egl-fix-fgPlatformDestroyContext-prototype-for-C23.patch diff --git a/package/libfreeglut/0002-Let-cmake-know-we-are-aware-there-are-newer-versions.patch b/package/libfreeglut/0002-Let-cmake-know-we-are-aware-there-are-newer-versions.patch new file mode 100644 index 0000000000..45f2fcf541 --- /dev/null +++ b/package/libfreeglut/0002-Let-cmake-know-we-are-aware-there-are-newer-versions.patch @@ -0,0 +1,26 @@ +From 2294389397912c9a6505a88221abb7dca0a4fb79 Mon Sep 17 00:00:00 2001 +From: John Tsiombikas +Date: Thu, 20 Mar 2025 09:28:29 +0200 +Subject: [PATCH] Let cmake know we are aware there are newer versions and we + don't care + +Closes issue #207 + +Upstream: https://github.com/freeglut/freeglut/commit/2294389397912c9a6505a88221abb7dca0a4fb79 + +Signed-off-by: Bernd Kuhls +[Bernd: rebased for version 3.6.0] +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 791771e7..e5903ef4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.1...3.5 FATAL_ERROR) + PROJECT(freeglut LANGUAGES C) + + if (POLICY CMP0072) diff --git a/package/libfreeglut/libfreeglut.hash b/package/libfreeglut/libfreeglut.hash index 249a780f04..233fa55457 100644 --- a/package/libfreeglut/libfreeglut.hash +++ b/package/libfreeglut/libfreeglut.hash @@ -1,3 +1,3 @@ # Locally computed -sha256 3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec freeglut-3.4.0.tar.gz +sha256 9c3d4d6516fbfa0280edc93c77698fb7303e443c1aaaf37d269e3288a6c3ea52 freeglut-3.6.0.tar.gz sha256 b6593d5ec4c113a274abb85b10e8615895cb0ddb89f7912af5fe5aa8df38a275 COPYING diff --git a/package/libfreeglut/libfreeglut.mk b/package/libfreeglut/libfreeglut.mk index 09309aeceb..bcca8b4abe 100644 --- a/package/libfreeglut/libfreeglut.mk +++ b/package/libfreeglut/libfreeglut.mk @@ -4,7 +4,7 @@ # ################################################################################ -LIBFREEGLUT_VERSION = 3.4.0 +LIBFREEGLUT_VERSION = 3.6.0 LIBFREEGLUT_SOURCE = freeglut-$(LIBFREEGLUT_VERSION).tar.gz LIBFREEGLUT_SITE = https://github.com/FreeGLUTProject/freeglut/releases/download/v$(LIBFREEGLUT_VERSION) LIBFREEGLUT_LICENSE = MIT