gio: Check for NUll when getting extensions

When unregistered extension point (i.e. NULL pointer) is passed
to `g_io_extension_point_get_extensions`, it causes a segfault.

This commit adds an assertion, to prevent this.

https://bugzilla.gnome.org/show_bug.cgi?id=779183
This commit is contained in:
Jan Tojnar 2017-02-24 16:46:55 +01:00 committed by Philip Withnall
parent ee09bb704f
commit 1a845115a2

View File

@ -1280,6 +1280,8 @@ lazy_load_modules (GIOExtensionPoint *extension_point)
GList *
g_io_extension_point_get_extensions (GIOExtensionPoint *extension_point)
{
g_return_val_if_fail (extension_point != NULL, NULL);
lazy_load_modules (extension_point);
return extension_point->extensions;
}