From: Linus Torvalds Date: Sat, 18 Aug 2012 16:48:15 +0000 (-0700) Subject: Fix uninitialized pointer crash for "Save As" X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=76fc14f1b4c62506a6a9a8ee27d21ec992a65993;p=ext%2Fsubsurface.git Fix uninitialized pointer crash for "Save As" The "filename" variable was only initialized when the user accepted the name, so cancelling the file save would randomly use an uninitialized pointer. Reported-by: Miika Turkia Signed-off-by: Linus Torvalds --- diff --git a/gtk-gui.c b/gtk-gui.c index 5bc46d2..18c19c7 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -173,7 +173,7 @@ static void file_open(GtkWidget *w, gpointer data) static void file_save_as(GtkWidget *w, gpointer data) { GtkWidget *dialog; - char *filename; + char *filename = NULL; dialog = gtk_file_chooser_dialog_new("Save File As", GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_SAVE,