mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 09:48:32 +00:00
utils: account for terminating \0 byte
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
2b2655a8c5
commit
ccd42a3144
@ -2417,7 +2417,7 @@ int parse_byte_size_string(const char *s, int64_t *converted)
|
|||||||
if (!s || !strcmp(s, ""))
|
if (!s || !strcmp(s, ""))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
end = stpncpy(dup, s, sizeof(dup));
|
end = stpncpy(dup, s, sizeof(dup) - 1);
|
||||||
if (*end != '\0')
|
if (*end != '\0')
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user