Commit c8d8cad1 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

sysfs: fix use_after_free issue

CID 73379 (#1 of 1): Use after free (USE_AFTER_FREE)
31. deref_arg: Calling fclose dereferences freed pointer fp.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e47eccb1
......@@ -211,8 +211,9 @@ int parse_aufs_branches(struct mount_info *mi)
* Now read branch pathnames from the branch files.
*/
n = strlen(path);
fp = NULL;
for (br_num = 0; br_num <= br_max; br_num++) {
fp = NULL;
ret = snprintf(&path[n], sizeof path - n, "/br%d", br_num);
if (ret >= sizeof path - n) {
pr_err("Buffer overrun creating path for branch %d\n", br_num);
......
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