mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
girepository: avoids segfault in case of bad gtype
If a <GType invalid> (that's the way it appears in python's debugger) is returned, `g_type_name` returns NULL. This function therefore returns NULL at this time as subsequent calls to `strlen( data->gtype_name)` segfault.
This commit is contained in:
parent
3d999b47e5
commit
6583ad7f4f
@ -812,6 +812,8 @@ g_irepository_find_by_gtype (GIRepository *repository,
|
||||
GIBaseInfo *cached;
|
||||
DirEntry *entry;
|
||||
|
||||
g_return_val_if_fail (gtype != G_TYPE_INVALID, NULL);
|
||||
|
||||
repository = get_repository (repository);
|
||||
|
||||
cached = g_hash_table_lookup (repository->priv->info_by_gtype,
|
||||
|
Loading…
Reference in New Issue
Block a user