[packages/ghostscript] add fixes for build failures with gcc 14

atler atler at pld-linux.org
Wed Jul 10 15:50:26 CEST 2024


commit 6901b6cb37b4cf8fcfb6b53af6b88423e99552b7
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jul 10 15:07:21 2024 +0200

    add fixes for build failures with gcc 14
    
    - gdevescp fix reported at https://bugs.ghostscript.com/show_bug.cgi?id=707868
    - pdf_sec fix already upstream

 gdevescp-fwrite.patch | 12 ++++++++++++
 ghostscript.spec      |  5 ++++-
 pdf_sec.patch         | 29 +++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/ghostscript.spec b/ghostscript.spec
index 6c69440..64c3c02 100644
--- a/ghostscript.spec
+++ b/ghostscript.spec
@@ -33,7 +33,8 @@ Source1:	http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-ma
 Patch0:		%{name}-missquotes.patch
 Patch1:		%{name}-a4.patch
 Patch2:		ijs-pkgconfig.patch
-
+Patch3:		gdevescp-fwrite.patch
+Patch4:		pdf_sec.patch
 Patch6:		%{name}-gdevcd8-fixes.patch
 
 # fedora
@@ -218,6 +219,8 @@ Statyczna wersja biblioteki IJS.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %patch6 -p1
 
diff --git a/gdevescp-fwrite.patch b/gdevescp-fwrite.patch
new file mode 100644
index 0000000..d08585b
--- /dev/null
+++ b/gdevescp-fwrite.patch
@@ -0,0 +1,12 @@
+diff -ur ghostscript-10.03.1.old/devices/gdevescp.c ghostscript-10.03.1/devices/gdevescp.c
+--- ghostscript-10.03.1.old/devices/gdevescp.c	2024-05-02 11:45:25.000000000 +0200
++++ ghostscript-10.03.1/devices/gdevescp.c	2024-07-10 10:47:10.751123360 +0200
+@@ -162,7 +162,7 @@
+         ** margin measured from the *top* of the page:
+         */
+ 
+-        fwrite("\033(U\001\0\n\033(C\002\0t\020\033(c\004\0\0\0t\020",
++        gp_fwrite("\033(U\001\0\n\033(C\002\0t\020\033(c\004\0\0\0t\020",
+                                                         1, 22, prn_stream);
+ #endif
+ 
diff --git a/pdf_sec.patch b/pdf_sec.patch
new file mode 100644
index 0000000..057be09
--- /dev/null
+++ b/pdf_sec.patch
@@ -0,0 +1,29 @@
+From 90cabe08422afdd16bac5dd9217602679d943045 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <Ken.Sharp at artifex.com>
+Date: Fri, 8 Mar 2024 09:19:05 +0000
+Subject: [PATCH] Bug #707649 - fix apply_sasl in error cases.
+
+Forgot to dereference the pointers before assigning the values, if we
+get non-fatal errors returned from stringprep.
+---
+ pdf/pdf_sec.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pdf/pdf_sec.c b/pdf/pdf_sec.c
+index 565ae80ca..7e8f6719d 100644
+--- a/pdf/pdf_sec.c
++++ b/pdf/pdf_sec.c
+@@ -183,8 +183,8 @@ static int apply_sasl(pdf_context *ctx, char *Password, int Len, char **NewPassw
+          * this easy: the errors we want to ignore are the ones with
+          * codes less than 100. */
+         if ((int)err < 100) {
+-            NewPassword = Password;
+-            NewLen = Len;
++            *NewPassword = Password;
++            *NewLen = Len;
+             return 0;
+         }
+ 
+-- 
+2.34.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ghostscript.git/commitdiff/6901b6cb37b4cf8fcfb6b53af6b88423e99552b7



More information about the pld-cvs-commit mailing list