Skip to content

Commit

Permalink
mount: Explicit null dereferenced (FORWARD_NULL)
Browse files Browse the repository at this point in the history
CID 181217 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
 Passing null pointer mntns to mntns_get_root_fd, which dereferences it.

Signed-off-by: Adrian Reber <areber@redhat.com>
  • Loading branch information
adrianreber authored and avagin committed Oct 20, 2020
1 parent 5f06740 commit 16aea4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -3585,6 +3585,10 @@ int mntns_get_root_fd(struct ns_id *mntns)
{
if (!(root_ns_mask & CLONE_NEWNS))
return __mntns_get_root_fd(0);

if (!mntns)
return -1;

/*
* All namespaces are restored from the root task and during the
* CR_STATE_FORKING stage the root task has two file descriptors for
Expand Down

0 comments on commit 16aea4a

Please sign in to comment.