Blob Blame Raw
From 43896debcea363d7dfa17290e9ed8462af0375a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= <ib@wupperonline.de>
Date: Mon, 22 Jun 2015 14:18:25 +0200
Subject: [PATCH] Check XdndDirectSave property received from destination

According to the Direct Save Protocol (XDS) specifications
the destination shall convert the XdndDirectSave property
to a URL.

Check whether this has happened to avoid a segmentation fault.

Reported by vincent-t on github.
---
 src/window.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/window.c b/src/window.c
index 5ba616e..7bd6cbb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1718,6 +1718,8 @@ void drag_data_get (GtkWidget *widget,GdkDragContext *dc,GtkSelectionData *selec
 		destination = g_filename_from_uri((gchar*)_destination,NULL,NULL);
 		g_free(_destination);
 
+		if (!destination) return;
+
 		archive->extraction_path = xa_remove_level_from_path (destination);
 		g_free(destination);
 
-- 
2.19.0