diff options
author | Stef Walter <stef@memberwebs.com> | 2008-12-09 21:57:09 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2008-12-09 21:57:09 +0000 |
commit | b5036fbe14ee8e6a1e98f34e4bf0bf499e19d406 (patch) | |
tree | 831e0a70e9ea8d2d5e5db916ae6563ad96ec4009 /module | |
parent | fb9374be05108422a9662217e727b940ef896bf6 (diff) |
Fix problem with objects being shared among slots.
Diffstat (limited to 'module')
-rw-r--r-- | module/p11-capi-token.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/module/p11-capi-token.c b/module/p11-capi-token.c index f6ef2ca..c76d6ce 100644 --- a/module/p11-capi-token.c +++ b/module/p11-capi-token.c @@ -177,6 +177,7 @@ object_hash_func(const void* a) { P11cObject* obj = (P11cObject*)a; unsigned int hash = p11c_hash_pointer(obj->obj_funcs); + hash ^= p11c_hash_integer((int)obj->slot); hash ^= (obj->obj_funcs->hash_object)(obj); return hash; } @@ -188,6 +189,8 @@ object_equal_func(const void* a, const void* b) P11cObject* cb = (P11cObject*)b; if(ca == cb) return 1; + if(ca->slot != cb->slot) + return 0; if(ca->obj_funcs != cb->obj_funcs) return 0; return (ca->obj_funcs->equal_object)(ca, cb); |