diff options
author | Matteo Bernardini | 2020-09-12 20:31:23 +0200 |
---|---|---|
committer | Matteo Bernardini | 2020-09-12 20:31:23 +0200 |
commit | b38ad4464a26bbe8c11a8ec3d2a44467a9f80c19 (patch) | |
tree | 79336dddbe92db427d5b2b9fd50541954114ff5c /system/gnomint/patches/05_export-private-key-crash.patch | |
parent | b2643f7815ef7bbf399288ba0e383b0f293ce05e (diff) | |
download | slackbuilds-current-20200912.1.tar.gz |
20200912.1 global branch merge.current-20200912.1
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system/gnomint/patches/05_export-private-key-crash.patch')
-rw-r--r-- | system/gnomint/patches/05_export-private-key-crash.patch | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/system/gnomint/patches/05_export-private-key-crash.patch b/system/gnomint/patches/05_export-private-key-crash.patch new file mode 100644 index 0000000000..e0a3fd2bcb --- /dev/null +++ b/system/gnomint/patches/05_export-private-key-crash.patch @@ -0,0 +1,83 @@ +Description: Fix crash when exporting the private key. + In ca_on_extractprivatekey1_activate, when calling + gtk_tree_model_get, GLib attempts to assign a guint64 value to a + variable declared gint (CA_MODEL_COLUMN_ID is defined as type + G_TYPE_UINT64 in the tree store). This corrupts the stack and also + invalidates the iter. + . + While investigating this, I noticed that the program happily leaks + GtkTreeIter's. Every time the user selects a certificate from the + tree view, the callback ca_treeview_selection_change invokes + __ca_selection_type which makes a copy of the iter with + gtk_tree_iter_copy. If the user chooses some action from the popup + menu, the toolbar or the main menu, __ca_selection_type is called + once again in the widget's callback function, copying another iter. + AFAICT these are never freed for the lifetime of the program. + . + This is not addressed by the patch as it would require some changes, + but it could be a source of trouble and something to watch out if + bugs like this pop up. According to the GTK+ API documentation, + gtk_tree_iter_copy is not supposed to be used by applications; + GtkTreeIter structs should be copied by value. +Bug-Debian: https://bugs.debian.org/855200 +Author: Yavor Doganov <yavor@gnu.org> +Forwarded: gnomint-devel@lists.sourceforge.net +Last-Update: 2018-09-02 +--- + +--- gnomint-1.3.0.orig/src/ca.c ++++ gnomint-1.3.0/src/ca.c +@@ -922,7 +922,7 @@ + GObject *widget = NULL; + gchar * filename = NULL; + GtkDialog * dialog = NULL; +- gint id; ++ guint64 id; + gchar * strerror = NULL; + + widget = gtk_builder_get_object (main_window_gtkb, "main_window1"); +@@ -973,7 +973,7 @@ + GObject *widget = NULL; + gchar * filename = NULL; + GtkDialog * dialog = NULL; +- gint id; ++ guint64 id; + gchar * error_msg = NULL; + + widget = gtk_builder_get_object (main_window_gtkb, "main_window1"); +@@ -1022,7 +1022,7 @@ + GObject *widget = NULL; + gchar * filename = NULL; + GtkDialog * dialog = NULL; +- gint id; ++ guint64 id; + + gchar *error_msg = NULL; + +@@ -1181,7 +1181,7 @@ + GtkTreeIter *iter; + gint type; + gchar *filename = NULL; +- gint id; ++ guint64 id; + + type = __ca_selection_type (GTK_TREE_VIEW(gtk_builder_get_object (main_window_gtkb, "ca_treeview")), &iter); + +@@ -1212,7 +1212,7 @@ + GtkTreeIter *iter; + gint type = __ca_selection_type (GTK_TREE_VIEW(gtk_builder_get_object (main_window_gtkb, "ca_treeview")), &iter); + gint response = 0; +- gint id = 0; ++ guint64 id = 0; + + if (type == CA_FILE_ELEMENT_TYPE_CSR) + return; +@@ -1267,7 +1267,7 @@ + GtkTreeIter *iter; + gint type = __ca_selection_type (GTK_TREE_VIEW(gtk_builder_get_object (main_window_gtkb, "ca_treeview")), &iter); + gint response = 0; +- gint id = 0; ++ guint64 id = 0; + + if (type != CA_FILE_ELEMENT_TYPE_CSR) + return; |