From 0eb3258a69fa168b2f9e0d44762261a150fc0ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 8 Mar 2021 09:14:20 +0100 Subject: [PATCH] ntdll: Initialize mountmgr_unix_drive before NtDeviceIoControlFile (valgrind). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Syscall param writev(vector[...]) points to uninitialised byte(s) at 0x4189DA3: writev (writev.c:26) by 0x46A5A1B: send_request (server.c:213) by 0x46A5A1B: server_call_unlocked (server.c:273) by 0x46CA54F: virtual_locked_server_call (virtual.c:2993) by 0x4681C9A: server_ioctl_file (file.c:4789) by 0x468B326: NtDeviceIoControlFile (file.c:5620) by 0x468B7AF: get_mountmgr_fs_info (file.c:1986) by 0x468B7AF: get_mountmgr_fs_info (file.c:1955) by 0x468FCBB: NtQueryVolumeInformationFile (file.c:6483) by 0x4677E88: __wine_syscall_dispatcher_xsave (in /home/rbernon/Code/build-wine/wine64/dlls/ntdll/ntdll.so) by 0x7BC0DEB3: NtQueryVolumeInformationFile (in /home/rbernon/Code/build-wine/wine64/dlls/ntdll/ntdll.dll) by 0x7B01F127: GetFileInformationByHandle (file.c:2938) by 0x7096A5C3: _fstat64 (file.c:1791) by 0x7096A941: _fstat64i32 (file.c:1877) Address 0x7ffffe30e520 is in a rw- anonymous segment Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- dlls/ntdll/unix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index c169b49343f..233778df3b2 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1963,13 +1963,13 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni letter = find_dos_device( unix_name ); free( unix_name ); + memset( drive, 0, sizeof(*drive) ); if (letter == -1) { struct stat st; fstat( fd, &st ); drive->unix_dev = st.st_rdev ? st.st_rdev : st.st_dev; - drive->letter = 0; } else drive->letter = 'a' + letter;