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:
Tilghman Lesher
2009-10-02 16:58:03 +00:00
parent 366ef836c1
commit 012b1bc180

View File

@@ -397,7 +397,7 @@ void *__ao2_link(struct ao2_container *c, void *user_data, int iax2_hack)
if (!p)
return NULL;
i = c->hash_fn(user_data, OBJ_POINTER);
i = abs(c->hash_fn(user_data, OBJ_POINTER));
ao2_lock(c);
i %= c->n_buckets;