From: Tilghman Lesher Date: Fri, 2 Oct 2009 17:01:42 +0000 (+0000) Subject: Merged revisions 221971 via svnmerge from X-Git-Tag: 1.6.1.7-rc2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a8847d42cfe94d10e6cfc3b36e31f66275a29b9;p=thirdparty%2Fasterisk.git 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.1@221973 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_lock.c b/funcs/func_lock.c index 432292b394..5d116e82c8 100644 --- a/funcs/func_lock.c +++ b/funcs/func_lock.c @@ -153,7 +153,7 @@ static void *lock_broker(void *unused) static int null_hash_cb(const void *obj, const int flags) { - return abs((int)(long) obj); + return (int)(long) obj; } static int null_cmp_cb(void *obj, void *arg, int flags) diff --git a/main/astobj2.c b/main/astobj2.c index 378a8311ed..c49432fa10 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -503,7 +503,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;