From: Christian Brauner Date: Thu, 10 May 2018 18:25:08 +0000 (+0200) Subject: utils: account for terminating \0 byte X-Git-Tag: lxc-3.1.0~313^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd42a31440f584a82bd8aa1f6e1b34bcc87e5b5;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 3d0f8641c..91bc802b4 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -2417,7 +2417,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;