From: Jeff King Date: Thu, 24 May 2018 17:06:00 GMT Subject: Re: [PATCH v2] rev-parse: check lookup'ed commit references for NULL Message-ID: <20180524170600.GB14876@sigill.intra.peff.net> In-Reply-To: <20180524062733.5412-1-newren@gmail.com> On Wed, May 23, 2018 at 11:27:33PM -0700, Elijah Newren wrote: > Commits 2122f8b963d4 ("rev-parse: Add support for the ^! and ^@ syntax", > 2008-07-26) and 3dd4e7320d ("Teach rev-parse the ... syntax.", 2006-07-04) > taught rev-parse new syntax, and used lookup_commit_reference() as part of > their logic. Neither usage checked the returned commit to see if it was > non-NULL before using it. Check for NULL and ensure an appropriate error > is reported to the user. > > Reported by Florian Weimer and Todd Zullinger. > > Helped-by: Jeff King > Signed-off-by: Elijah Newren This version looks good to me. Thanks for taking care of this! -Peff