From: Christian Brauner Date: Thu, 10 May 2018 18:25:08 +0000 (+0200) Subject: utils: account for terminating \0 byte X-Git-Tag: lxc-2.0.10~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00a3088cc1918fab2160e5f4510d2166174a2b11;p=thirdparty%2Flxc.git utils: account for terminating \0 byte Signed-off-by: Christian Brauner --- diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 757579f9b..aa1676a01 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2384,7 +2384,7 @@ int parse_byte_size_string(const char *s, int64_t *converted) if (!s || !strcmp(s, "")) return -EINVAL; - end = stpncpy(dup, s, sizeof(dup)); + end = stpncpy(dup, s, sizeof(dup) - 1); if (*end != '\0') return -EINVAL;