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

Re: [PATCH] fetch--tool: fix uninitialized buffer when reading from stdin

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 26, 2007, 18:05 UTC
Message-ID
<Pine.LNX.4.64.0702261003480.12485@woody.linux-foundation.org>
In-Reply-To
<Pine.LNX.4.63.0702261827510.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Mon, 26 Feb 2007, Johannes Schindelin wrote:
Show 8 quoted lines
> Hi,
> 
> On Mon, 26 Feb 2007, Linus Torvalds wrote:
> 
> > I suspect you only tested with small input to stdin.
> 
> Addendum: yes, I only tested with a reflist which was smaller than one 
> megabyte ;-)

Well, that CHUNK_SIZE is just silly. I don't see why you'd have a chunk-size of a megabyte to begin with, IO doesn't really get any more efficient that way. And yeah, in this case it would easily hide the bug, because in practice nobody would ever test with that much input data.

It might make sense to make the chunk-size smaller just from a testability standpoint (not to mention that it's probably currently just wasting memory for most users - although at least under Linux, if you never use a page, none will be allocated for you, so the OS may hide the wastage).

		Linus
Previous: Johannes SchindelinNext: Junio C Hamano
Message 7 of 10 in “fetch--tool: fix uninitialized buffer when reading from stdin”
  1. fetch--tool: fix uninitialized buffer when reading from stdinJohannes Schindelin, Feb 26, 2007
  2. Linus TorvaldsFeb 26, 2007
  3. Johannes SchindelinFeb 26, 2007
  4. Linus TorvaldsFeb 26, 2007
  5. Johannes SchindelinFeb 26, 2007
  6. Johannes SchindelinFeb 26, 2007
  7. Linus TorvaldsFeb 26, 2007
  8. Junio C HamanoFeb 26, 2007
  9. Junio C HamanoFeb 26, 2007
  10. Johannes SchindelinFeb 27, 2007

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.