From: Jinoh Kang <jinoh.kang.kr@gmail.com> --- dlls/ntdll/unix/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index d413bbbc0ab..9050ebc5500 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -2154,6 +2154,9 @@ static NTSTATUS server_get_name_info( HANDLE handle, FILE_NAME_INFORMATION *info const WCHAR *ptr = name->Name.Buffer; const WCHAR *end = ptr + name->Name.Length / sizeof(WCHAR); + /* The caller has verified that the handle has an associated fd */ + if (ptr == end) WARN( "handle %p is an anonymous file", handle ); + /* Skip the volume mount point. */ while (ptr != end && *ptr == '\\') ++ptr; while (ptr != end && *ptr != '\\') ++ptr; @@ -2162,7 +2165,6 @@ static NTSTATUS server_get_name_info( HANDLE handle, FILE_NAME_INFORMATION *info info->FileNameLength = (end - ptr) * sizeof(WCHAR); if (*name_len < info->FileNameLength) status = STATUS_BUFFER_OVERFLOW; - else if (!info->FileNameLength) status = STATUS_INVALID_INFO_CLASS; else *name_len = info->FileNameLength; if (info->FileNameLength) memcpy( info->FileName, ptr, *name_len ); free( name ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10651