Skip to content

Commit

Permalink
utils: check for snprintf() error
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 883a6f8 commit fde1420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lxc/utils.c
Expand Up @@ -1301,6 +1301,8 @@ int mount_from_at(int dfd_from, const char *path_from,

ret = snprintf(dst_buf, sizeof(dst_buf), "/proc/self/fd/%d", fd_to);
}
if (ret < 0 || ret >= sizeof(src_buf))
return -EIO;

if (is_empty_string(src_buf))
ret = mount(NULL, dst_buf, fstype, mnt_flags, data);
Expand Down

0 comments on commit fde1420

Please sign in to comment.