From: Yu Watanabe Date: Wed, 19 Jun 2019 05:15:06 +0000 (+0900) Subject: dhcp: use memdup_suffix0() instead of strndup() X-Git-Tag: v243-rc1~267^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79cd22d6f389c3ee6d711a4c54dc39d3ce6a8c79;p=thirdparty%2Fsystemd.git dhcp: use memdup_suffix0() instead of strndup() --- diff --git a/src/libsystemd-network/dhcp-option.c b/src/libsystemd-network/dhcp-option.c index a68de4ff98e..0abb8fdef02 100644 --- a/src/libsystemd-network/dhcp-option.c +++ b/src/libsystemd-network/dhcp-option.c @@ -198,7 +198,7 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo if (memchr(option, 0, len - 1)) return -EINVAL; - string = strndup((const char *) option, len); + string = memdup_suffix0((const char *) option, len); if (!string) return -ENOMEM;