mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-28 01:26:59 -04:00
BUG/MEDIUM: resolvers: fix truncated TLD consecutive to the API fix
A bug was introduced by commit previous bf9498a31 ("MINOR: resolvers:
fix the resolv_str_to_dn_label() API about trailing zero") as the code
is particularly contrived and hard to test. The output writes the last
char at [i+1] so the trailing zero and return value must be at i+1.
This will have to be backported where the patch above is backported
since it was needed for a fix.
This commit is contained in:
parent
cc8fd4c040
commit
7b232f132d
1 changed files with 2 additions and 2 deletions
|
|
@ -1686,8 +1686,8 @@ int resolv_str_to_dn_label(const char *str, int str_len, char *dn, int dn_len)
|
|||
dn[i+1] = str[i];
|
||||
}
|
||||
dn[offset] = i - offset;
|
||||
dn[i] = '\0';
|
||||
return i;
|
||||
dn[i+1] = '\0';
|
||||
return i+1;
|
||||
}
|
||||
|
||||
/* Validates host name:
|
||||
|
|
|
|||
Loading…
Reference in a new issue