summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-18 09:48:15 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-18 09:48:15 -0700
commit76fc14f1b4c62506a6a9a8ee27d21ec992a65993 (patch)
tree66f5e873999a4c892a5e6d5d3c2c6a5cc713a8e2
parent52c3d11d2c2a0415bf501abff6c9f99b6a7f2cce (diff)
downloadsubsurface-76fc14f1b4c62506a6a9a8ee27d21ec992a65993.tar.gz
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 <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--gtk-gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 5bc46d219..18c19c79f 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,