commit:     76116a0cc9f6727023b1c1b26dc462eb66c86d70
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  4 23:42:09 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Thu Mar  4 23:42:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76116a0c

app-arch/gtk-splitter: fix compilation with format-security

Closes: https://bugs.gentoo.org/520974
Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../files/gtk-splitter-2.2.1-format-security.patch | 44 ++++++++++++++++++++++
 app-arch/gtk-splitter/gtk-splitter-2.2.1-r2.ebuild |  7 +++-
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git 
a/app-arch/gtk-splitter/files/gtk-splitter-2.2.1-format-security.patch 
b/app-arch/gtk-splitter/files/gtk-splitter-2.2.1-format-security.patch
new file mode 100644
index 00000000000..7c8cb0e382a
--- /dev/null
+++ b/app-arch/gtk-splitter/files/gtk-splitter-2.2.1-format-security.patch
@@ -0,0 +1,44 @@
+--- a/src/dostextfile.c
++++ b/src/dostextfile.c
+@@ -30,14 +30,14 @@
+ /* Write a string to the file pointed to by b without the eoln. */
+ void write_dostextfile(FILE *b, char *data)
+ {
+-   fprintf( b, data );
++   fprintf( b, "%s", data );
+    fflush( b );
+ }
+ 
+ /* Write a string to the file pointed to by b with the eoln. */
+ void writeln_dostextfile(FILE *b, char *data)
+ {
+-   fprintf( b, data );
++   fprintf( b, "%s", data );
+    fputc( 0x0d, b );
+    fputc( 0x0a, b );
+    fflush( b );
+--- a/src/interface.c
++++ b/src/interface.c
+@@ -216,6 +216,7 @@
+                                     GTK_DIALOG_MODAL,
+                                     GTK_MESSAGE_ERROR,
+                                     GTK_BUTTONS_CLOSE,
++                                    "%s", 
+                                     error );
+                                     
+    /* Display the error dialog. */  
+@@ -233,12 +234,14 @@
+                                        GTK_DIALOG_MODAL,
+                                        GTK_MESSAGE_INFO,
+                                        GTK_BUTTONS_CLOSE,
++                                       "%s",
+                                        "File verification successful" );
+    else
+       dialog = gtk_message_dialog_new( NULL,
+                                        GTK_DIALOG_MODAL,
+                                        GTK_MESSAGE_WARNING,
+                                        GTK_BUTTONS_CLOSE,
++                                     "%s",
+                                        "File verification unsuccessful" );
+                                     
+    /* Display the error dialog. */  

diff --git a/app-arch/gtk-splitter/gtk-splitter-2.2.1-r2.ebuild 
b/app-arch/gtk-splitter/gtk-splitter-2.2.1-r2.ebuild
index 288cc392dda..8cfa2563d8f 100644
--- a/app-arch/gtk-splitter/gtk-splitter-2.2.1-r2.ebuild
+++ b/app-arch/gtk-splitter/gtk-splitter-2.2.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -19,7 +19,10 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
-PATCHES=( "${FILESDIR}"/${P}-r1-desktop-QA-fixes.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-r1-desktop-QA-fixes.patch
+       "${FILESDIR}"/${P}-format-security.patch
+)
 
 src_configure() {
        default

Reply via email to