Skip to content

Commit

Permalink
utils: fix unchecked return value
Browse files Browse the repository at this point in the history
Fixes: Coverity 1465853
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 10, 2020
1 parent 504ce60 commit 999f514
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lxc/utils.c
Expand Up @@ -1094,7 +1094,9 @@ int __safe_mount_beneath_at(int beneath_fd, const char *src, const char *dst, co
source_fd = openat2(beneath_fd, src, &how, sizeof(how));
if (source_fd < 0)
return -errno;
snprintf(src_buf, sizeof(src_buf), "/proc/self/fd/%d", source_fd);
ret = snprintf(src_buf, sizeof(src_buf), "/proc/self/fd/%d", source_fd);
if (ret < 0 || ret >= sizeof(src_buf))
return -EIO;
} else {
src_buf[0] = '\0';
}
Expand Down

0 comments on commit 999f514

Please sign in to comment.