summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-01 09:53:15 +0200
committerDaniel Mack <github@zonque.org>2015-10-01 09:53:15 +0200
commit2ce8d6080d4135ae8926fc783766c3dfbeb7a6b0 (patch)
tree6ffd2519d5623fa971709a856540daa2bf6dbe3e /src/libsystemd-network
parente4c46dcede2cf41ebd0910dfb0788b23f1f6da45 (diff)
parentef08ced6b44d4f56477a6798e56ba5c5c9e0023f (diff)
Merge pull request #1429 from poettering/dhcp-hostname
DHCP and journal remoting fix, as well as NEWS update
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index aa07846693..df3d8e6e3c 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -314,10 +314,14 @@ static int lease_parse_string(const uint8_t *option, size_t len, char **ret) {
else {
char *string;
- if (memchr(option, 0, len))
+ /*
+ * One trailing NUL byte is OK, we don't mind. See:
+ * https://github.com/systemd/systemd/issues/1337
+ */
+ if (memchr(option, 0, len - 1))
return -EINVAL;
- string = strndup((const char *)option, len);
+ string = strndup((const char *) option, len);
if (!string)
return -ENOMEM;