[gnome-panel] Make sure URI has been converted to path



commit 2754ba11918ddd399ee2ff23ea2e4f19175ec43e
Author: Gustavo Noronha Silva <gustavo noronha collabora co uk>
Date:   Wed Jan 6 23:44:03 2010 -0200

    Make sure URI has been converted to path
    
    https://bugzilla.gnome.org/show_bug.cgi?id=606277

 gnome-panel/panel-util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/panel-util.c b/gnome-panel/panel-util.c
index 4b00d91..3b8c608 100644
--- a/gnome-panel/panel-util.c
+++ b/gnome-panel/panel-util.c
@@ -951,6 +951,10 @@ panel_util_get_icon_for_uri_known_folders (const char *uri)
 
 	path = g_filename_from_uri (uri, NULL, NULL);
 
+	/* Sanity check. We may be given a broken URI. */
+	if (path == NULL)
+		return NULL;
+
 	len = strlen (path);
 	if (path[len] == '/')
 		path[len] = '\0';



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