Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f534a21e0b
!19 修复rpm包description中的拼写错误
From: @lvzhl 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2024-10-18 01:56:08 +00:00
lvzhonglin
01b334d955 fix spell mistake 2024-10-15 13:59:52 +08:00
openeuler-ci-bot
ed13becdb2
!9 Fix CVE-2024-24258 and CVE-2024-24259
From: @wk333 
Reviewed-by: @starlet-dx 
Signed-off-by: @starlet-dx
2024-02-18 03:07:53 +00:00
wk333
18fb98df1e Fix CVE-2024-24258 and CVE-2024-24259 2024-02-18 10:32:39 +08:00
openeuler-ci-bot
68802e6a16 !4 fix failure caused by GCC upgrade to 10
From: @Lin__Jiaxin
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-08-04 07:54:21 +00:00
linjiaxin
431d8dc786 fix build error due to gcc 10
refer to: https://www.linuxfromscratch.org/patches/blfs/svn/freeglut-3.2.1-gcc10_fix-1.patch
2021-08-03 21:32:19 +08:00
openeuler-ci-bot
801ffa413c !2 add yaml file
Merge pull request !2 from Captain.Wei/master
2020-05-19 09:29:46 +08:00
Captain Wei
6c590fa386 add yaml file 2020-05-11 15:43:33 +08:00
openeuler-ci-bot
956fd2e923 !1 add source
Merge pull request !1 from sigui/sgs-refreash
2019-12-10 16:31:42 +08:00
sigui
ca7243bca0 add source 2019-12-10 16:23:14 +08:00
6 changed files with 181 additions and 0 deletions

View File

@ -0,0 +1,51 @@
From 9ad320c1ad1a25558998ddfe47674511567fec57 Mon Sep 17 00:00:00 2001
From: Sebastian Rasmussen <sebras@gmail.com>
Date: Mon, 12 Feb 2024 14:46:22 +0800
Subject: [PATCH] Plug memory leak that happens upon error.
Origin: https://github.com/freeglut/freeglut/commit/9ad320c1ad1a25558998ddfe47674511567fec57
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.
---
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 53112dc21..0da88901d 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;

BIN
freeglut-3.0.0.tar.gz Normal file

Binary file not shown.

81
freeglut.spec Normal file
View File

@ -0,0 +1,81 @@
Name: freeglut
Version: 3.0.0
Release: 13
Summary: A freely licensed alternative to the GLUT library
License: MIT
URL: http://freeglut.sourceforge.net
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1: https://downloads.sourceforge.net/openglut/openglut-0.6.3-doc.tar.gz
Patch0: gcc-10.patch
Patch1: CVE-2024-24258-and-CVE-2024-24259.patch
BuildRequires: gcc gcc-c++ cmake libXi-devel libICE-devel
BuildRequires: pkgconfig libGLU-devel libXext-devel libXxf86vm-devel
Provides: glut = 3.7
Obsoletes: glut < 3.7
%description
Freeglut is a free-software/open-source alternative to the OpenGL Utility
Toolkit (GLUT) library. GLUT was originally written to support the sample
programs in the second edition OpenGL 'RedBook'. Since then, GLUT has been used
in a wide variety of practical applications because it is simple, widely
available and highly portable.
%package devel
Summary: Freeglut developmental libraries and header files
Requires: %{name} = %{version}-%{release} libGL-devel libGLU-devel
Provides: glut-devel = 3.7
Obsoletes: glut-devel < 3.7
%description devel
This package provides developmental libraries and header files required for
developing or compilingsoftware which links to the freeglut library.
%package help
Summary: Help information and man pages for freeglut
%description help
This package provides man-pages and involved help info for freeglut
%prep
%autosetup -n %{name}-%{version} -a 1 -p1
%build
%{cmake} -DFREEGLUT_BUILD_STATIC_LIBS=OFF .
%make_build
%install
%make_install
install -d $RPM_BUILD_ROOT/%{_mandir}/man3
install -p -m 644 doc/man/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%doc AUTHORS ChangeLog COPYING
%{_libdir}/libglut.so.3*
%files devel
%{_includedir}/GL/*.h
%{_libdir}/libglut.so
%{_libdir}/pkgconfig/freeglut.pc
%files help
%{_mandir}/man3/*
%doc README doc/*.png doc/*.html
%changelog
* Fri Oct 11 2024 lvzhonglin <lvzhonglin@inspur.com> - 3.0.0-13
- update description
* Sun Feb 18 2024 wangkai <13474090681@163.com> - 3.0.0-12
- Fix CVE-2024-24258 and CVE-2024-24259
* Fri Jul 30 2021 linjiaxin5 <linjiaxin5@huawei.com> - 3.0.0-11
- Fix failure caused by GCC upgrade to 10
* Fri Nov 22 2019 sunguoshuai <sunguoshuai@huawei.com> - 3.0.0-10
- Package init.

4
freeglut.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: dcnieho/FreeGLUT
tag_prefix: ^FG_
seperator: _

45
gcc-10.patch Normal file
View File

@ -0,0 +1,45 @@
--- a/src/fg_gl2.c
+++ b/src/fg_gl2.c
@@ -26,6 +26,20 @@
#include <GL/freeglut.h>
#include "fg_internal.h"
#include "fg_gl2.h"
+
+#ifndef GL_ES_VERSION_2_0
+/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
+ * names are defined in fg_gl2.h header to reference them, for any other case,
+ * define them as function pointers here.
+ */
+FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+FGH_PFNGLBUFFERDATAPROC fghBufferData;
+FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+#endif
void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
if (fgStructure.CurrentWindow != NULL)
--- a/src/fg_gl2.h
+++ b/src/fg_gl2.h
@@ -67,13 +67,13 @@
typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
-FGH_PFNGLBUFFERDATAPROC fghBufferData;
-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
+extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
# endif

BIN
openglut-0.6.3-doc.tar.gz Normal file

Binary file not shown.