aboutsummaryrefslogtreecommitdiffstats
path: root/main/astobj2.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-02 16:58:03 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-02 16:58:03 +0000
commit2a1f2f6cedd38b4103db07cd2be9a94599327978 (patch)
treef86b14a8daa485ddcb0e0a679269db596aa0ba20 /main/astobj2.c
parentfd899f06543c87b9e8acc50faff01a5818cbc6b5 (diff)
Ensure the result of the hash function is positive. Negative array offsets suck.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221970 f38db490-d61c-443f-a65b-d21fe96a405b
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 89839aadc..e7ec2de91 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -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;