Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-09 Thread Junio C Hamano
Johannes Schindelin writes: >> Besides avoiding a segfault, one of the benefits of regcomp_buf() is >> that we will now find pickaxe-regex strings inside mixed binary/text >> files. But it's not clear to me that NetBSD's implementation does this. >> >> I guess we can

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-09 Thread Johannes Schindelin
Hi Peff, On Thu, 8 Sep 2016, Jeff King wrote: > On Thu, Sep 08, 2016 at 09:29:58AM +0200, Johannes Schindelin wrote: > > > sorry for the late answer, I was really busy trying to come up with a new > > and improved version of the patch series, and while hunting a bug I > > introduced got bogged

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-08 Thread Jeff King
On Thu, Sep 08, 2016 at 09:29:58AM +0200, Johannes Schindelin wrote: > sorry for the late answer, I was really busy trying to come up with a new > and improved version of the patch series, and while hunting a bug I > introduced got bogged down with other tasks. No problem. I am not in a hurry.

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-08 Thread Johannes Schindelin
Hi Peff, sorry for the late answer, I was really busy trying to come up with a new and improved version of the patch series, and while hunting a bug I introduced got bogged down with other tasks. The good news is that I made up my mind about releasing a Git for Windows v2.10.0(2): originally, I

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Jeff King
On Tue, Sep 06, 2016 at 04:06:32PM +0200, Johannes Schindelin wrote: > > I think re_search() the correct replacement function but it's been a > > while since I've looked into it. > > The segfault I investigated happened in a call to strlen(). I see many > calls to strlen() in compat/regex/...

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Johannes Schindelin
Hi Peff, On Tue, 6 Sep 2016, Jeff King wrote: > On Mon, Sep 05, 2016 at 05:44:57PM +0200, Johannes Schindelin wrote: > > > The problem with that: mmap()ed memory is *not* NUL-terminated, yet > > the pickaxe code calls regexec() on it just the same. > > > > This problem has been reported by my

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Johannes Schindelin
Hi Peff & Junio, On Tue, 6 Sep 2016, Jeff King wrote: > On Mon, Sep 05, 2016 at 12:10:11PM -0700, Junio C Hamano wrote: > > > * We could use variant of regexp engine as you proposed, > >which I think is a preferrable solution. Do people know of a > >widely accepted

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Johannes Schindelin
Hi Junio, On Mon, 5 Sep 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > This patch series addresses a problem where `git diff` is called using > > `-G` or `-S --pickaxe-regex` on new-born files that are configured > > without user diff drivers, and

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Jeff King
On Mon, Sep 05, 2016 at 12:10:11PM -0700, Junio C Hamano wrote: > * We could use variant of regexp engine as you proposed, >which I think is a preferrable solution. Do people know of a >widely accepted implementation that we can throw into compat/ as >fallback that is

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-06 Thread Jeff King
On Mon, Sep 05, 2016 at 05:44:57PM +0200, Johannes Schindelin wrote: > The problem with that: mmap()ed memory is *not* NUL-terminated, yet the > pickaxe code calls regexec() on it just the same. > > This problem has been reported by my colleague Chris Sidi. > > Please note that this patch

Re: [PATCH 0/3] Fix a segfault caused by regexec() being called on mmap()ed data

2016-09-05 Thread Junio C Hamano
Johannes Schindelin writes: > This patch series addresses a problem where `git diff` is called using > `-G` or `-S --pickaxe-regex` on new-born files that are configured > without user diff drivers, and that hence get mmap()ed into memory. Good spotting. This has