Bug: kernel: file.c

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug: kernel: file.c

Ivan Gyurdiev
This makes the Battlefield 2 demo go a bit further, before crashing
again, due to unimplemented call ntdll.dll.NtSetSystemInformation.

The mask parameter is not initialized by RtlDosPathNameToNtPathName_U
(it returns TRUE in that first block), and then you get an invalid
dereference later.




diff -Naurp kernel/file.c kernel.new/file.c
--- kernel/file.c 2005-10-15 04:54:41.000000000 -0400
+++ kernel.new/file.c 2005-10-15 04:51:36.000000000 -0400
@@ -1435,7 +1435,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR
                                 LPVOID data, FINDEX_SEARCH_OPS search_op,
                                 LPVOID filter, DWORD flags)
 {
-    WCHAR *mask, *p;
+    WCHAR *mask = NULL, *p;
     FIND_FIRST_INFO *info = NULL;
     UNICODE_STRING nt_name;
     OBJECT_ATTRIBUTES attr;


Reply | Threaded
Open this post in threaded view
|

Re: Bug: kernel: file.c

Ivan Gyurdiev
Ivan Gyurdiev wrote:
> This makes the Battlefield 2 demo go a bit further, before crashing
> again, due to unimplemented call ntdll.dll.NtSetSystemInformation.
>
> The mask parameter is not initialized by RtlDosPathNameToNtPathName_U
> (it returns TRUE in that first block), and then you get an invalid
> dereference later.
Never mind, I see this is being fixed differently by James Hawkins.





Reply | Threaded
Open this post in threaded view
|

Re: Bug: kernel: file.c

James Hawkins
On 10/15/05, Ivan Gyurdiev <[hidden email]> wrote:
> Ivan Gyurdiev wrote:
> > This makes the Battlefield 2 demo go a bit further, before crashing
> > again, due to unimplemented call ntdll.dll.NtSetSystemInformation.
> >
> > The mask parameter is not initialized by RtlDosPathNameToNtPathName_U
> > (it returns TRUE in that first block), and then you get an invalid
> > dereference later.
> Never mind, I see this is being fixed differently by James Hawkins.
>

When I was first looking through this bug, I tried setting mask to
NULL as well, but that just hides the fact that
RtlDosPathNameToNtPathName_U doesn't fill in the file_part parameter
for long file names as it should.  My approach was incorrect, but I'll
go back and work something else out.

--
James Hawkins