From: Lennart Poettering Date: Thu, 7 Jan 2016 18:43:56 +0000 (+0100) Subject: resolved: make sure domain name hash function deals nicely with NUL embedded in labels X-Git-Tag: v229~151^2~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=509eddd202f2d0962379defe1c483d5c9bd482c8;p=thirdparty%2Fsystemd.git resolved: make sure domain name hash function deals nicely with NUL embedded in labels --- diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 3848a0518d0..729508e6a51 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 */