]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: fix off-by-one error in array allocation for sscanf
authorFelix Abecassis <fabecassis@nvidia.com>
Thu, 24 May 2018 03:51:42 +0000 (20:51 -0700)
committerFelix Abecassis <fabecassis@nvidia.com>
Thu, 24 May 2018 03:54:32 +0000 (20:54 -0700)
The maximum field width does not include the null terminator.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
src/lxc/seccomp.c

index eeb9c8bf39a9cb8f7728e7a356bf7d85f2d0bbc3..6a0a1ffd0d3d98d5a8bf98b999f48f84b4d5f04a 100644 (file)
@@ -181,7 +181,7 @@ static int get_seccomp_arg_value(char *key, struct v2_rule_args *rule_args)
        uint64_t mask = 0;
        enum scmp_compare op = 0;
        uint32_t index = 0;
-       char s[30] = {0};
+       char s[31] = {0};
        char *tmp = NULL;
 
        memset(s, 0, sizeof(s));