diff options
author | Pavel Holejsovsky <pavel.holejsovsky@gmail.com> | 2012-05-12 07:44:57 +0200 |
---|---|---|
committer | Pavel Holejsovsky <pavel.holejsovsky@gmail.com> | 2012-05-12 20:48:55 +0200 |
commit | d055d35a873be5978d82df3955d859399c2e30d9 (patch) | |
tree | d9cb3ae43fc09d363958ee8712983fab00c6d9d3 /girepository/gthash-test.c | |
parent | 39fc1013ba84d885272123e954b2aea27d5117cd (diff) | |
download | gobject-introspection-d055d35a873be5978d82df3955d859399c2e30d9.tar.gz |
girepository: avoid crash when querying nonexistent info
It appears that cmph library can return (n+1) when querying item not
present in its original n-item-sized set. Adjust code so that it
detects this condition and do not chase stray pointers resulting from
this bogus(?) hash result.
https://bugzilla.gnome.org/show_bug.cgi?id=675939
Diffstat (limited to 'girepository/gthash-test.c')
-rw-r--r-- | girepository/gthash-test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/girepository/gthash-test.c b/girepository/gthash-test.c index 7909a0c8..ea811e35 100644 --- a/girepository/gthash-test.c +++ b/girepository/gthash-test.c @@ -47,10 +47,10 @@ test_build_retrieve (void) _gi_typelib_hash_builder_destroy (builder); - g_assert (_gi_typelib_hash_search (buf, "Action") == 0); - g_assert (_gi_typelib_hash_search (buf, "ZLibDecompressor") == 42); - g_assert (_gi_typelib_hash_search (buf, "VolumeMonitor") == 9); - g_assert (_gi_typelib_hash_search (buf, "FileMonitorFlags") == 31); + g_assert (_gi_typelib_hash_search (buf, "Action", 4) == 0); + g_assert (_gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); + g_assert (_gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); + g_assert (_gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); } int |