Re: [PATCH] pathspec: fix segfault in clear_pathspec
- Date: Fri, 7 Apr 2017 12:39:57 -0700
- From: Stefan Beller <sbeller@xxxxxxxxxx>
- Subject: Re: [PATCH] pathspec: fix segfault in clear_pathspec
On Fri, Apr 7, 2017 at 12:29 PM, Brandon Williams <bmwill@xxxxxxxxxx> wrote:
> In 'clear_pathspec()' the incorrect index parameter is used to bound an
> inner-loop which is used to free a 'struct attr_match' value field.
> Using the incorrect index parameter (in addition to being incorrect)
> occasionally causes segmentation faults when attempting to free an
> invalid pointer. Fix this by using the correct index parameter 'i'.
This was introduced via b0db704652 (pathspec: allow querying for
attributes, 2017-03-13), and it seems there was no other topics
in flight since then or at the time. So the review failed to spot it
and not some other weird root cause.