mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-10 23:07:05 +00:00
Ensure the result of the hash function is positive. Negative array offsets suck.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@221970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -397,7 +397,7 @@ void *__ao2_link(struct ao2_container *c, void *user_data, int iax2_hack)
|
|||||||
if (!p)
|
if (!p)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
i = c->hash_fn(user_data, OBJ_POINTER);
|
i = abs(c->hash_fn(user_data, OBJ_POINTER));
|
||||||
|
|
||||||
ao2_lock(c);
|
ao2_lock(c);
|
||||||
i %= c->n_buckets;
|
i %= c->n_buckets;
|
||||||
|
Reference in New Issue
Block a user