Commit 9ba0baab authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: fix dereference after null check

CID 1168169 (#1 of 1): Dereference after null check (FORWARD_NULL)
7. var_deref_model: Passing "mi" to function "do_bind_mount(struct
   mount_info *)", which dereferences null "mi->bind"
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1e0e8370
...@@ -1305,7 +1305,7 @@ static int restore_ext_mount(struct mount_info *mi) ...@@ -1305,7 +1305,7 @@ static int restore_ext_mount(struct mount_info *mi)
static int do_bind_mount(struct mount_info *mi) static int do_bind_mount(struct mount_info *mi)
{ {
bool shared = mi->shared_id && mi->shared_id == mi->bind->shared_id; bool shared = 0;
if (!mi->need_plugin) { if (!mi->need_plugin) {
char *root, rpath[PATH_MAX]; char *root, rpath[PATH_MAX];
...@@ -1322,6 +1322,8 @@ static int do_bind_mount(struct mount_info *mi) ...@@ -1322,6 +1322,8 @@ static int do_bind_mount(struct mount_info *mi)
goto do_bind; goto do_bind;
} }
shared = mi->shared_id && mi->shared_id == mi->bind->shared_id;
/* /*
* Cut common part of root. * Cut common part of root.
* For non-root binds the source is always "/" (checked) * For non-root binds the source is always "/" (checked)
......
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