Segmentation fault?




Hi, all.

I have one problem. 
But, I don't know whether I'm confusing or not.
Pardon me for saying so.

There are a part of gcache.c in glib-1.2.3.
------------------------------
 1: void
 2: g_cache_remove (GCache   *cache,
 3:                 gpointer  value)
 4: {
 5:   GRealCache *rcache;
 6:   GCacheNode *node;
 7:   gpointer key;
 8: 
 9:   g_return_if_fail (cache != NULL);
10: 
11:   rcache = (GRealCache*) cache;
12: 
13:   key = g_hash_table_lookup (rcache->value_table, value);
14:   node = g_hash_table_lookup (rcache->key_table, key);
15: 
16:   node->ref_count -= 1;
17:   ...
------------------------------

If 'value' is NULL or non registerd value with 'cache' 
when g_cache_remove() is called, 
I think at line 16 is dangerous.

Thank you for your generosity.

                                    Shimaki Matsubara
                                    shimaki@bb.mbn.or.jp



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