git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] rev-parse: check lookup'ed commit references for NULL

From
Jeff King <peff@peff.net>
Date
May 24, 2018, 17:06 UTC
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:
Show 11 quoted lines
> 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 <peff@peff.net>
> Signed-off-by: Elijah Newren <newren@gmail.com>
This version looks good to me. Thanks for taking care of this!
-Peff
Previous: Florian WeimerNext: Junio C Hamano
Message 10 of 14 in “BUG: rev-parse segfault with invalid input”
  1. Todd ZullingerMay 23, 2018
  2. Elijah NewrenMay 23, 2018
  3. Todd ZullingerMay 23, 2018
  4. 1/2 t6101: add a test for rev-parse $garbage^@Elijah Newren, May 23, 2018
  5. 2/2 rev-parse: verify that commit looked up is not NULLElijah Newren, May 23, 2018
  6. Jeff KingMay 23, 2018
  7. rev-parse: check lookup'ed commit references for NULLElijah Newren, May 24, 2018
  8. Todd ZullingerMay 24, 2018
  9. Florian WeimerMay 24, 2018
  10. Jeff KingMay 24, 2018
  11. Junio C HamanoMay 25, 2018
  12. Todd ZullingerMay 23, 2018
  13. Todd ZullingerMay 23, 2018
  14. Jeff KingMay 23, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.