Re: [PATCH v2 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:33:29AM +0200, Johannes Schindelin wrote: > On Thu, 8 Sep 2016, Johannes Schindelin wrote: > > > We solve this by introducing a helper, regexec_buf(), that takes a > > pointer and a length instead of a NUL-terminated string. > > BTW I should have clarified why I decide

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

2016-09-08 Thread Johannes Schindelin
Hi, On Thu, 8 Sep 2016, Johannes Schindelin wrote: > We solve this by introducing a helper, regexec_buf(), that takes a > pointer and a length instead of a NUL-terminated string. BTW I should have clarified why I decided on another name than regexecn() (I had considered this even before reading

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

2016-09-08 Thread Johannes Schindelin
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. The problem with that: mmap()ed memory is *not* NUL-terminated, yet the pickaxe code calls r