From 4c71d6239f9ca9ab734d2ba40fb329ca5ccbfe97 Mon Sep 17 00:00:00 2001 From: Christian Huitema Date: Sat, 21 Jan 2017 14:49:58 -0800 Subject: [PATCH] Fixing potential bug for comparision function net_req_query_id_cmp on 64 bits architectures. --- src/context.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/context.c b/src/context.c index 987d5ea2..fd93c68b 100644 --- a/src/context.c +++ b/src/context.c @@ -819,10 +819,11 @@ tls_only_is_in_transports_list(getdns_context *context) { static int net_req_query_id_cmp(const void *id1, const void *id2) { - return (intptr_t)id1 - (intptr_t)id2; -} -/* -{ + /* + * old code was: + * return (intptr_t)id1 - (intptr_t)id2; + *but this is incorrect on 64 bit architectures. + */ int ret = 0; if (id1 != id2) @@ -832,7 +833,7 @@ net_req_query_id_cmp(const void *id1, const void *id2) return ret; } -*/ + static getdns_tsig_info const tsig_info[] = { { GETDNS_NO_TSIG, NULL, 0, NULL, 0, 0, 0 }