Re: [PATCH 0/2] Fix crashes due to real_pathdup() potentially returning NULL
- Date: Thu, 9 Mar 2017 12:26:13 +0100 (CET)
- From: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
- Subject: Re: [PATCH 0/2] Fix crashes due to real_pathdup() potentially returning NULL
On Wed, 8 Mar 2017, Jeff King wrote:
> On Wed, Mar 08, 2017 at 04:43:27PM +0100, Johannes Schindelin wrote:
> > We may want to consider fast-tracking this into v2.12.1, and to that
> > end, I would appreciate code reviews that focus on the correctness of
> > this patch and that try to consider undesired side effects.
> I don't see how it could be not-correct, in the sense that every caller
> now passes the die_on_error flag (restoring the original behavior)
> except for the one which clearly checks for a NULL return immediately
Indeed. The principal reason why I extended the function signature was so
that any bugs would become obvious.
> The only exception would be if there were new calls to real_pathdup()
> that did not originally use real_path(). But:
> # 7241764076 introduced real_pathdup
> git log -Sreal_pathdup 7241764076..
> shows only one other introduction, and it's just duplicating an existing
Thanks for digging that up. I really only looked at the existing code in
`master` to figure out whether the return values were checked against NULL
> It's possible that some of these _could_ handle the error case more
> gracefully (I already fixed one such case in 3a1345af2). But even if
> we wanted to do so, that should come separately on top of this patch.
> This can go to 'maint' as a regression fix, and then that gives a stable
> base for making potential improvements.
Thank you for the thorough review,