utils: fix unchecked return value

Fixes: Coverity 1465853 Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2f787f1f
...@@ -1094,7 +1094,9 @@ int __safe_mount_beneath_at(int beneath_fd, const char *src, const char *dst, co ...@@ -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)); source_fd = openat2(beneath_fd, src, &how, sizeof(how));
if (source_fd < 0) if (source_fd < 0)
return -errno; 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 { } else {
src_buf[0] = '\0'; src_buf[0] = '\0';
} }
......
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