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

SEGV when lookup_* returns NULL

From
Martin Waitz <tali@admingilde.org>
Date
Nov 27, 2006, 21:13 UTC
Message-ID
<20061127211315.GC18810@admingilde.org>
hoi :)

When trying to an unmodified GIT on a repository with submodules it segfaults a lot.

All the lookup_{blob,tree,commit} functions check that the object really is of the requested type and return NULL otherwise. However this NULL pointer is not checked in the calling functions.

Should we make lookup_* to just die when invoked on another object-type? Or modify all the callers? Is there a sane error-handling strategy besides dying in this case? Really checking all the return values in the whole chain would be a lot of work.

-- 
Martin Waitz
Next: Junio C Hamano
Message 1 of 5 in “SEGV when lookup_* returns NULL”
  1. Martin WaitzNov 27, 2006
  2. Junio C HamanoNov 27, 2006
  3. Johannes SchindelinNov 27, 2006
  4. Junio C HamanoNov 28, 2006
  5. Morten WelinderNov 28, 2006

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.