Possible issue with check_dir_not_empty

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Nov 19 18:53:21 GMT 2024


Hi Bernhard,

On Nov 18 22:32, Bernhard Übelacker via Cygwin wrote:
> Hello Corinna,
> 
> Am 18.11.24 um 17:52 schrieb Corinna Vinschen:
> > Hi Bernhard,
> > 
> > On Nov 16 23:36, Bernhard Übelacker via Cygwin wrote:
> > > Hello everyone,
> > > 
> > > Is is about the buffer allocated in check_dir_not_empty.
> > > 
> > > The pointer pfni gets allocated the buffer at the begin,
> > > and is used in the NtQueryDirectoryFile call before the loops.
> > > In the loop the pointer pfni is also used as iterator.
> > > Therefore it holds no longer the initial buffer at the call
> > > to NtQueryDirectoryFile in the while conditition at the bottom.
> > 
> > Good catch, thank you!
> 
> Forgot to mention the background. I actually hit this issue with running
> Cygwin's git.exe below a modified Wine checking out the tag 3.5.3 of
> newlib-cygwin. Unfortunately reproducing this issue still needs a few
> additional Wine patches to finish Cygwin installation.
> 
> 
> > > Attached is a possible modification to always use the allocated buffer.
> > > 
> > > Kind regards,
> > > Bernhard
> > 
> > Thanks for the patch.
> > 
> > Would you be ok if I apply a simplified version under your authorship?
> > 
> > Rather than add a pfni_it(erator), use pfni as iterator and add a
> > pfni_buf variable.  This is a much smaller patch, and is more in line
> > with the usual variable naming in Cygwin.
> > 
> > I also added a release message text and a Fixes: line to the commit
> > message.
> > 
> > Below is the tweaked patch.  If you're ok with this version, I'll push
> > it.
> 
> 
> That would be great. Thanks for maintaining Cygwin.

Thanks for the patch!  I pushed it this morning.


Corinna


More information about the Cygwin mailing list