Skip to content

Commit 09e9a48

Browse files
committed
fixup: smart: uninitialized buffer on mount(2)
The `struct stat` object used inside mount(2) is uninitialized, which can lead to undefined behavior during running Changes: - Set zero to buffer before calling to stat() Signed-off-by: Shell <[email protected]>
1 parent f8ea6c6 commit 09e9a48

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Diff for: components/lwp/lwp_syscall.c

-2
Original file line numberDiff line numberDiff line change
@@ -5805,8 +5805,6 @@ sysret_t sys_mount(char *source, char *target,
58055805
copy_source = NULL;
58065806
}
58075807

5808-
struct stat buf;
5809-
58105808
if (copy_source && stat(copy_source, &buf) && S_ISBLK(buf.st_mode))
58115809
{
58125810
char *dev_fullpath = dfs_normalize_path(RT_NULL, copy_source);

0 commit comments

Comments
 (0)