mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
ntdll: Null-terminate strings returned by VFAT_IOCTL_READDIR_BOTH to work around a kernel bug.
This commit is contained in:
parent
5ede40ab5d
commit
3f2da592ad
@ -911,6 +911,9 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG
|
||||
while (res != -1)
|
||||
{
|
||||
if (!de[0].d_reclen) break;
|
||||
/* make sure names are null-terminated to work around an x86-64 kernel bug */
|
||||
if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
|
||||
if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
|
||||
if (de[1].d_name[0])
|
||||
info = append_entry( buffer, &io->Information, length,
|
||||
de[1].d_name, de[0].d_name, mask );
|
||||
@ -942,6 +945,9 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG
|
||||
while (res != -1)
|
||||
{
|
||||
if (!de[0].d_reclen) break;
|
||||
/* make sure names are null-terminated to work around an x86-64 kernel bug */
|
||||
if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
|
||||
if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
|
||||
if (de[1].d_name[0])
|
||||
info = append_entry( buffer, &io->Information, length,
|
||||
de[1].d_name, de[0].d_name, mask );
|
||||
@ -1247,6 +1253,9 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
|
||||
for (;;)
|
||||
{
|
||||
if (!de[0].d_reclen) break;
|
||||
/* make sure names are null-terminated to work around an x86-64 kernel bug */
|
||||
if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
|
||||
if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
|
||||
|
||||
if (de[1].d_name[0])
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user