From 509eddd202f2d0962379defe1c483d5c9bd482c8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 7 Jan 2016 19:43:56 +0100 Subject: resolved: make sure domain name hash function deals nicely with NUL embedded in labels --- src/shared/dns-domain.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 3848a0518d..729508e6a5 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -503,10 +503,8 @@ void dns_name_hash_func(const void *s, struct siphash *state) { if (r == 0) break; - label[r] = 0; - ascii_strlower(label); - - string_hash_func(label, state); + ascii_strlower_n(label, r); + siphash24_compress(label, r, state); } /* enforce that all names are terminated by the empty label */ -- cgit v1.2.3-54-g00ecf