[packages/qalculate-gtk] add qalculate-wformat-security.patch from fedora

glen glen at pld-linux.org
Sat Oct 24 19:25:06 CEST 2015


commit 0a315145931de955fe7bfc5c233fe3fab91b9aa9
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Oct 24 20:00:14 2015 +0300

    add qalculate-wformat-security.patch from fedora

 qalculate-gtk.spec               |  4 +++-
 qalculate-wformat-security.patch | 48 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)
---
diff --git a/qalculate-gtk.spec b/qalculate-gtk.spec
index 6b2379e..5bca68e 100644
--- a/qalculate-gtk.spec
+++ b/qalculate-gtk.spec
@@ -8,6 +8,7 @@ Group:		Applications/Math
 Source0:	http://downloads.sourceforge.net/qalculate/%{name}-%{version}.tar.gz
 # Source0-md5:	7a7ab4680e285690ca3625992f477f0f
 Patch0:		desktop.patch
+Patch1:		qalculate-wformat-security.patch
 URL:		http://qalculate.sourceforge.net/
 BuildRequires:	automake
 BuildRequires:	cln-devel >= 1.1.0
@@ -40,7 +41,8 @@ graficzny interfejs (GTK+).
 
 %prep
 %setup -q
-%patch0 -p1
+%patch0 -p0
+%patch1 -p0
 
 %build
 %configure
diff --git a/qalculate-wformat-security.patch b/qalculate-wformat-security.patch
new file mode 100644
index 0000000..db5185d
--- /dev/null
+++ b/qalculate-wformat-security.patch
@@ -0,0 +1,48 @@
+Description: Fix compiling with -Werror=format-security.
+ Prevents format string attacks.
+Author: Simon Ruderich <simon at ruderich.org>
+Last-Update: 2013-05-23
+
+--- src/callbacks.cc
++++ src/callbacks.cc.new
+@@ -388,12 +388,12 @@ void wrap_expression_selection() {
+ }
+ 
+ void show_message(const gchar *text, GtkWidget *win) {
+-	GtkWidget *edialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, text);
++	GtkWidget *edialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", text);
+ 	gtk_dialog_run(GTK_DIALOG(edialog));
+ 	gtk_widget_destroy(edialog);
+ }
+ bool ask_question(const gchar *text, GtkWidget *win) {
+-	GtkWidget *edialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, text);
++	GtkWidget *edialog = gtk_message_dialog_new(GTK_WINDOW(win), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, "%s", text);
+ 	int question_answer = gtk_dialog_run(GTK_DIALOG(edialog));
+ 	gtk_widget_destroy(edialog);
+ 	return question_answer == GTK_RESPONSE_YES;
+@@ -654,7 +654,7 @@ void display_errors(GtkTextIter *iter =
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+ 					GTK_MESSAGE_INFO,
+ 					GTK_BUTTONS_CLOSE,
+-					CALCULATOR->message()->message().c_str());
++					"%s", CALCULATOR->message()->message().c_str());
+ 			gtk_dialog_run(GTK_DIALOG(edialog));
+ 			gtk_widget_destroy(edialog);
+ 		}
+@@ -667,14 +667,14 @@ void display_errors(GtkTextIter *iter =
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+ 					GTK_MESSAGE_ERROR,
+ 					GTK_BUTTONS_CLOSE,
+-					str.c_str());
++					"%s", str.c_str());
+ 		} else {
+ 			edialog = gtk_message_dialog_new(
+ 					GTK_WINDOW(win),
+ 					GTK_DIALOG_DESTROY_WITH_PARENT,
+ 					GTK_MESSAGE_WARNING,
+ 					GTK_BUTTONS_CLOSE,
+-					str.c_str());
++					"%s", str.c_str());
+ 		}
+ 
+ 		gtk_dialog_run(GTK_DIALOG(edialog));
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qalculate-gtk.git/commitdiff/1089392fb2ba72ef261220ef8c4a98eeb7edf467



More information about the pld-cvs-commit mailing list