[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#264887: GLOB_APPEND ignored by glob() in at least one place



# control bcc-ed
tag 264887 + moreinfo
thanks

On Tue, Aug 10, 2004 at 02:41:27PM -0500, Jeff Licquia wrote:
> Package: libc6
> Version: 2.3.2.ds1-13
> Tags: patch
> 
> When the GLOB_APPEND flag is passed to glob(), the call is supposed to
> tack new results on to the ones already represented in the glob_t passed
> in.  If there is an error, partial results may be added, but the
> original glob_t should definitely be left alone.
> 
> This is not respected in at least one part of glibc's glob
> implementation.  In this particular place, globfree() is called on the
> glob_t regardless of the flags passed.  Since glob() is implemented
> recursively with GLOB_APPEND added to the flags, this can affect the
> results returned even from a call where GLOB_APPEND is not set.
> 
> The following patch fixes the one instance of this behavior I found.

  I've looked at the code, and if I do understand what you mean with
your patch, I don't undestand how to trigger a case where the code would
not work, please consider that your patch is applied in a part of the
code that is very specific, and guarded by many checks, are you sure it
isn't safe to proceed the way it's done ?

  Please provide a testcase here that your patch solves, without that
the patch won't be applied as afaict it could be a memory leak as well.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpDMh8NebWfA.pgp
Description: PGP signature


Reply to: