[glib] giomodule: Add a NULL guard to extension_point_get_extension_by_name



commit 0e44b29340a1e3db140064d7c34070904e3fd8be
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Apr 10 15:26:45 2014 +0200

    giomodule: Add a NULL guard to extension_point_get_extension_by_name
    
    ... otherwise a NULL input will lead to a crash in strcmp.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727964

 gio/giomodule.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 18b7933..043ec19 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -1253,6 +1253,8 @@ g_io_extension_point_get_extension_by_name (GIOExtensionPoint *extension_point,
 {
   GList *l;
 
+  g_return_val_if_fail (name != NULL, NULL);
+
   lazy_load_modules (extension_point);
   for (l = extension_point->extensions; l != NULL; l = l->next)
     {


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