[evince] shell: Fix potential read-after-free in gsettings use



commit 41ce0e16cc3f395766abb239f990dd98c3144001
Author: Christian Persch <chpe gnome org>
Date:   Thu Feb 13 13:58:57 2014 +0100

    shell: Fix potential read-after-free in gsettings use
    
    It's not valid to use '&' with g_settings_get().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723737

 shell/ev-window.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 65ed151..5ac0a23 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -2432,12 +2432,13 @@ ev_window_file_chooser_restore_folder (EvWindow       *window,
                                        const gchar    *uri,
                                        GUserDirectory  directory)
 {
-        const gchar *folder_uri, *dir;
+        const gchar *dir;
+        gchar *folder_uri;
         gchar *parent_uri = NULL;
 
         g_settings_get (ev_window_ensure_settings (window),
                         get_settings_key_for_directory (directory),
-                        "m&s", &folder_uri);
+                        "ms", &folder_uri);
         if (folder_uri == NULL && uri != NULL) {
                 GFile *file, *parent;
 
@@ -2458,6 +2459,7 @@ ev_window_file_chooser_restore_folder (EvWindow       *window,
                                                      dir ? dir : g_get_home_dir ());
         }
 
+        g_free (folder_uri);
         g_free (parent_uri);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]