projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6267e8
)
resolved-util: NUL-terminate host label
author
Ronan Pigott
<ronan@rjp.ie>
Sat, 16 Dec 2023 19:45:07 +0000
(12:45 -0700)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Sun, 17 Dec 2023 07:56:43 +0000
(16:56 +0900)
In case the host has a 63-byte hostname, we must have enough space for a
NUL terminator as well.
src/resolve/resolved-util.c
patch
|
blob
|
history
diff --git
a/src/resolve/resolved-util.c
b/src/resolve/resolved-util.c
index 00abada426ccebfc1c26bd1c3af4054035dce029..adcd35d6bee8483b781fbef9fe83fc834de574f1 100644
(file)
--- a/
src/resolve/resolved-util.c
+++ b/
src/resolve/resolved-util.c
@@
-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;