resolved-util: NUL-terminate host label

In case the host has a 63-byte hostname, we must have enough space for a
NUL terminator as well.
This commit is contained in:
Ronan Pigott 2023-12-16 12:45:07 -07:00 committed by Yu Watanabe
parent e6267e832b
commit f5de77fa08

View File

@ -14,7 +14,7 @@ int resolve_system_hostname(char **full_hostname, char **first_label) {
#elif HAVE_LIBIDN
int k;
#endif
char label[DNS_LABEL_MAX];
char label[DNS_LABEL_MAX+1];
const char *p, *decoded;
int r;