From 107dc767391902d5d3b000deecafb804c1c68c1b Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 27 Jul 2017 09:05:16 +0200 Subject: [PATCH] core: dns cache - avoid bitshifting with more than the size - avoid undefined behaviour as per C specs --- src/core/dns_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c index 7f3e33875d5..e8bfd7f5e62 100644 --- a/src/core/dns_cache.c +++ b/src/core/dns_cache.c @@ -2344,7 +2344,7 @@ inline static struct dns_rr* dns_srv_get_nxt_rr(struct dns_hash_entry* e, #endif /* i is the winner */ *no=n; /* grp. start */ - srv_mark_tried(tried, i); /* mark it */ + if(i<8*sizeof(*tried)) srv_mark_tried(tried, i); /* mark it */ return r_sums[i].rr; no_more_rrs: *no=n;