[glib/glib-2-22] Bug 595138 - GFile not robust with invalid input



commit 7a1b265e97442aae1f42e504deb85ac0e58bfc83
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Nov 18 18:43:30 2009 -0600

    Bug 595138 - GFile not robust with invalid input
    
    Improve handling of g_file_query_default_handler() when called on an
    invalid GFile (ie: one created with an invalid URI).
    (cherry picked from commit 9681d7e75f2d1296a890bfa64b3478ea7025df62)

 gio/gfile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index c4a72e3..e311a41 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -5956,7 +5956,7 @@ g_file_query_default_handler (GFile                  *file,
   char *path;
   
   uri_scheme = g_file_get_uri_scheme (file);
-  if (uri_scheme)
+  if (uri_scheme && uri_scheme[0] != '\0')
     {
       appinfo = g_app_info_get_default_for_uri_scheme (uri_scheme);
       g_free (uri_scheme);



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