Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170601020042.GJ1627@brightrain.aerifal.cx>
Date: Wed, 31 May 2017 22:00:42 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] glob: fix / matching

On Sun, May 28, 2017 at 05:06:45PM +0200, Julien Ramseier wrote:
> 
> > Le 28 mai 2017 à 04:55, Rich Felker <dalias@...c.org> a écrit :
> >> 
> >> I'm confused how this patch differs from just removing the "if (*p)"
> >> condition before calling match_in_dir. Does match_in_dir actually work
> >> if p points to an empty string? I thought not...
> > 
> > Hmm, just removing the "if (*p)" seems to make it work; it looks like
> > match_in_dir covers this case fine. I'd like a second opinion on
> > whether this looks okay since I haven't touched this code in years,
> > but I suspect it'll turn out to be an okay fix for now...
> > 
> 
> 
> The "if (*p)" is needed, otherwise match_in_dir will append an empty
> match when p = "". 

Indeed. How about the attached?

I did look at your patch, and although it's probably fine, it does
have additional side effects like moving the length check across the
slash-skipping. That's part of why I looked for a minimally invasive
approach.

Rich

View attachment "globroot.diff" of type "text/plain" (485 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.