diff options
author | Colin Walters <walters@verbum.org> | 2010-07-14 11:59:11 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-07-14 11:59:11 -0400 |
commit | 05ffd85793207a40264a701de609614ba6e32d44 (patch) | |
tree | 166cff248bc9a8fba570b53b9738822d6f436635 /girepository/girepository.c | |
parent | 30920a48928f158b25579e898f4b80b648ef2120 (diff) | |
download | gobject-introspection-05ffd85793207a40264a701de609614ba6e32d44.tar.gz |
[girepository] Actually verify header of loaded typelibs in g_irepository_require
Take a GError * for typelib loading code, validate the header. This
fixes bizarre errors from gjs where g_irepository_require would happily
load old typelibs.
Diffstat (limited to 'girepository/girepository.c')
-rw-r--r-- | girepository/girepository.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/girepository/girepository.c b/girepository/girepository.c index ba6756ea..ef3d6d22 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -1221,7 +1221,9 @@ g_irepository_require (GIRepository *repository, goto out; } - typelib = g_typelib_new_from_mapped_file (mfile); + typelib = g_typelib_new_from_mapped_file (mfile, error); + if (!typelib) + goto out; header = (Header *) typelib->data; typelib_namespace = g_typelib_get_string (typelib, header->namespace); typelib_version = g_typelib_get_string (typelib, header->nsversion); |