[PATCH] ntdll: Don't append directory entries if the filename length is less than 1.

Alexandre Julliard julliard at winehq.org
Thu Oct 30 17:40:27 CDT 2008


"Lei Zhang" <thestig at google.com> writes:

> On Thu, Oct 30, 2008 at 4:08 AM, Alexandre Julliard <julliard at winehq.org> wrote:
>> "Lei Zhang" <thestig at google.com> writes:
>>
>>> I saw the following in a +file trace a user sent me:
>>>
>>> trace:file:FindNextFileW returning L"" (L"")
>>>
>>> I tried fixing FindNextFileW(), but that patch didn't get accepted.
>>> I'm guessing we should fix the problem in NtQueryDirectoryFile() so
>>> nobody who call it will get back an empty file name.
>>
>> This should never happen. You should figure out where the empty name
>> comes from and fix the caller.
>
> It's probably because we didn't check d_ino, patch sent. Though
> wouldn't it be good to have some sanity checking in append_entry(),
> since all the read_directory helper functions use it?

I'm not a big fan of the belt-and-suspenders approach. If the callers
are behaving correctly there's no need for an extra check, and if they
aren't then we shouldn't attempt to cope with their bugs. Besides,
there's no guarantee that invalid entries would be empty, they may also
contain garbage, and we can't fix that in append_entry.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list