summaryrefslogtreecommitdiff
path: root/main/astobj2.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-10-02 16:59:57 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-10-02 16:59:57 +0000
commitc1c25181af992f1e12b3c3b4a59cf741aa0189b1 (patch)
tree04822200e1a546a5d919124e4d8911c3c9bb56ce /main/astobj2.c
parentba10edfcac0e8ee9c5ac434e059ea07cdb439767 (diff)
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: https://origsvn.digium.com/svn/asterisk/trunk@221971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index a86e5271f..ad6dcb1a2 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -509,7 +509,7 @@ static struct bucket_list *internal_ao2_link(struct ao2_container *c, void *user
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;