aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-02 17:01:58 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-02 17:01:58 +0000
commit551537bb1023cb5386956e38cba8fba7de9d7c80 (patch)
tree892bc8250a777c36d98569be71dabf578485549c
parent2fd7d05107008e72481df88961630f0c8ecd8ba5 (diff)
Merged revisions 221971 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r221971 | tilghman | 2009-10-02 11:59:57 -0500 (Fri, 02 Oct 2009) | 9 lines Merged revisions 221970 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r221970 | tilghman | 2009-10-02 11:58:03 -0500 (Fri, 02 Oct 2009) | 2 lines Ensure the result of the hash function is positive. Negative array offsets suck. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@221974 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/astobj2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 11d89fbaf..a5ae37ca3 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -508,7 +508,7 @@ static struct bucket_list *__ao2_link(struct ao2_container *c, void *user_data,
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;