summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/dns-domain.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index 729508e6a5..bcfc93608c 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -486,13 +486,15 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
assert(p);
- while (*p) {
+ for (;;) {
char label[DNS_LABEL_MAX+1];
int k;
r = dns_label_unescape(&p, label, sizeof(label));
if (r < 0)
break;
+ if (r == 0)
+ break;
k = dns_label_undo_idna(label, r, label, sizeof(label));
if (k < 0)
@@ -500,9 +502,6 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
if (k > 0)
r = k;
- if (r == 0)
- break;
-
ascii_strlower_n(label, r);
siphash24_compress(label, r, state);
}