]> git.pld-linux.org Git - packages/qalculate-gtk.git/commitdiff
add qalculate-wformat-security.patch from fedora
authorElan Ruusamäe <glen@delfi.ee>
Sat, 24 Oct 2015 17:00:14 +0000 (20:00 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 24 Oct 2015 17:00:14 +0000 (20:00 +0300)
qalculate-gtk.spec
qalculate-wformat-security.patch [new file with mode: 0644]

index 6b2379edbedb025dcefd983781751aee08a1a488..5bca68eba462c3e3ddbfcedbe2047a715c504bcf 100644 (file)
@@ -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 (file)
index 0000000..db5185d
--- /dev/null
@@ -0,0 +1,48 @@
+Description: Fix compiling with -Werror=format-security.
+ Prevents format string attacks.
+Author: Simon Ruderich <simon@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));
This page took 0.315102 seconds and 4 git commands to generate.