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

Re: SEGV when lookup_* returns NULL

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 27, 2006, 23:33 UTC
Message-ID
<Pine.LNX.4.63.0611280032300.30004@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vu00kftbq.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 27 Nov 2006, Junio C Hamano wrote:
Show 12 quoted lines
> Martin Waitz <tali@admingilde.org> writes:
> 
> > 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?
> 
> Making lookup_{specific type} die when they see unexpected type
> would not hurt that much, I think, aside from the possibility
> that some callers may check NULL to see if object already
> exists, but they should be using has_sha1_file() instead.
And it would totally clobber the long term goal of libifying git.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.