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: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@221972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-10-02 17:00:52 +00:00
parent d0bee2f7ba
commit 9dfff8203a

View File

@@ -395,7 +395,7 @@ void *ao2_link(struct ao2_container *c, void *user_data)
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;