Skip to content

Commit

Permalink
utils: don't deref after NULL check
Browse files Browse the repository at this point in the history
Fixes: Coverity 1465855
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Oct 28, 2020
1 parent ec0befe commit 3715d0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/utils.c
Expand Up @@ -1113,7 +1113,7 @@ int safe_mount_beneath(const char *beneath, const char *src, const char *dst, co
__do_close int beneath_fd = -EBADF;
const char *path = beneath ? beneath : "/";

beneath_fd = openat(-1, beneath, O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_PATH);
beneath_fd = openat(-1, path, O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_PATH);
if (beneath_fd < 0)
return log_error_errno(-errno, errno, "Failed to open %s", path);

Expand Down

0 comments on commit 3715d0c

Please sign in to comment.