Re: [PATCH 2/2] rev-parse: verify that commit looked up is not NULL

2018-05-23 Thread Todd Zullinger
I wrote: > Thanks. This fixes the segfault. While I was testing this, > I wondered if the following cases should differ: Nevermind me. Jeff beat me to a reply and included much more useful details about why this occurs and suggestions for fixing it. :) > # f*40 > $ ./git-rev-parse

Re: [PATCH 2/2] rev-parse: verify that commit looked up is not NULL

2018-05-23 Thread Todd Zullinger
Elijah Newren wrote: > In commit 2122f8b963d4 ("rev-parse: Add support for the ^! and ^@ syntax", > 2008-07-26), try_parent_shorthands() was introduced to parse the special > ^! and ^@ syntax. However, it did not check the commit returned from > lookup_commit_reference() before proceeding to use

Re: [PATCH 2/2] rev-parse: verify that commit looked up is not NULL

2018-05-23 Thread Jeff King
On Wed, May 23, 2018 at 01:46:13PM -0700, Elijah Newren wrote: > In commit 2122f8b963d4 ("rev-parse: Add support for the ^! and ^@ syntax", > 2008-07-26), try_parent_shorthands() was introduced to parse the special > ^! and ^@ syntax. However, it did not check the commit returned from >

[PATCH 2/2] rev-parse: verify that commit looked up is not NULL

2018-05-23 Thread Elijah Newren
In commit 2122f8b963d4 ("rev-parse: Add support for the ^! and ^@ syntax", 2008-07-26), try_parent_shorthands() was introduced to parse the special ^! and ^@ syntax. However, it did not check the commit returned from lookup_commit_reference() before proceeding to use it. If it is NULL, bail