From d15e7d116a6753d9cc2aae392c6ef1cf41b84c3f Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Wed, 26 May 2021 16:31:03 +0200 Subject: [PATCH] Backport fixes for issues found by Coverity scan Resolves: #1964066 --- freetype-2.10.4-covscan.patch | 45 +++++++++++++++++++++++++++++++++++ freetype.spec | 10 +++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 freetype-2.10.4-covscan.patch diff --git a/freetype-2.10.4-covscan.patch b/freetype-2.10.4-covscan.patch new file mode 100644 index 0000000..d42ca75 --- /dev/null +++ b/freetype-2.10.4-covscan.patch @@ -0,0 +1,45 @@ +--- freetype-2.10.4/builds/unix/freetype-config.in ++++ freetype-2.10.4/builds/unix/freetype-config.in +@@ -32,9 +32,6 @@ cflags=`%PKG_CONFIG% --cflags freetype2` + dynamic_libs=`pkgconf --libs freetype2` + static_libs=`pkgconf --static --libs freetype2` + +-orig_prefix=$prefix +-orig_exec_prefix=$exec_prefix +- + orig_includedir=$includedir + orig_libdir=$libdir + +--- freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c ++++ freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c +@@ -749,6 +749,7 @@ + { + fprintf( stderr, + "couldn't allocate memory to pre-load font file\n" ); ++ fclose( file ); + + return 1; + } +@@ -758,9 +759,12 @@ + fprintf( stderr, "read error\n" ); + free( memory_file ); + memory_file = NULL; ++ fclose( file ); + + return 1; + } ++ ++ fclose( file ); + } + + error = FT_New_Memory_Face( lib, +--- freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c ++++ freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c +@@ -662,6 +662,7 @@ + break; + + default: ++ free( t ); + return; + } + diff --git a/freetype.spec b/freetype.spec index 0c8f516..190dec8 100644 --- a/freetype.spec +++ b/freetype.spec @@ -4,7 +4,7 @@ Summary: A free and portable font rendering engine Name: freetype Version: 2.10.4 -Release: 4%{?dist} +Release: 5%{?dist} License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement URL: http://www.freetype.org Source: http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.xz @@ -29,6 +29,9 @@ Patch6: freetype-2.10.1-debughook.patch Patch7: freetype-2.10.4-png-memory-leak.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1964066 +Patch8: freetype-2.10.4-covscan.patch + BuildRequires: gcc BuildRequires: libX11-devel BuildRequires: libpng-devel @@ -92,6 +95,7 @@ popd %patch5 -p1 -b .internal-outline %patch6 -p1 -b .debughook %patch7 -p1 -b .png-memory-leak +%patch8 -p1 -b .covscan %build @@ -233,6 +237,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la} %{_mandir}/man1/* %changelog +* Wed May 26 2021 Marek Kasik - 2.10.4-5 +- Backport fixes for issues found by Coverity scan +- Resolves: #1964066 + * Thu Apr 15 2021 Mohan Boddu - 2.10.4-4 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937