[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] ntdll: Don't append directory entries if the filename
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2008-10-30 22:40:27
Message-ID: 87k5bphfl0.fsf () wine ! dyndns ! org
[Download RAW message or body]

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

> On Thu, Oct 30, 2008 at 4:08 AM, Alexandre Julliard <julliard@winehq.org> wrote:
>> "Lei Zhang" <thestig@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@winehq.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic