Commit 4ef15244 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

proc_parse: allocate memory for the terminating null of the string

CID 996207 (#1 of 1): Out-of-bounds access (OVERRUN)
5. alloc_strlen: Allocating insufficient memory for the terminating null of the string.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9c3a88c7
......@@ -770,7 +770,7 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
new->fstype = find_fstype_by_name(fstype);
free(fstype);
new->options = xmalloc(strlen(opt));
new->options = xmalloc(strlen(opt) + 1);
if (!new->options)
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment