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

Re: [PATCH 2/2] cat-file: Fix an gcc -Wuninitialized warning

From
Jeff King <peff@peff.net>
Date
Mar 26, 2013, 19:38 UTC
Message-ID
<20130326193805.GA28880@sigill.intra.peff.net>
In-Reply-To
<20130326193539.GB28244@sigill.intra.peff.net>
On Tue, Mar 26, 2013 at 03:35:39PM -0400, Jeff King wrote:
> I note that we do not actually check that contents != NULL after calling
> read_sha1_file, either (nor that sha1_object_info does not return an
> error). I suspect cat-file could segfault under the right conditions.

Oh nevermind, we do. We just do it by checking that "type" was filled in correctly, which can combine the check for both read_sha1_file and sha1_object_info. Sorry for the noise.

-Peff
Previous: Jeff KingNext: Ramsay Jones
Message 3 of 6 in “cat-file: Fix an gcc -Wuninitialized warning”
  1. 2/2 cat-file: Fix an gcc -Wuninitialized warningRamsay Jones, Mar 26, 2013
  2. Jeff KingMar 26, 2013
  3. Jeff KingMar 26, 2013
  4. Ramsay JonesMar 28, 2013
  5. Jeff KingMar 28, 2013
  6. Jonathan NiederMar 28, 2013

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.