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

Re: [PATCH 3/6] tree-walk: use size_t consistently

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 1, 2019, 18:17 UTC
Message-ID
<b99561c9-cd7c-aca0-c7dd-a9916b7bd429@gmail.com>
In-Reply-To
<20190731043818.GC27170@sigill.intra.peff.net>
On 7/31/2019 12:38 AM, Jeff King wrote:
Show 9 quoted lines
> We store and manipulate the cumulative traverse_info.pathlen as an
> "int", which can overflow when we are fed ridiculously long pathnames
> (e.g., ones at the edge of 2GB or 4GB, even if the individual tree entry
> names are smaller than that). The results can be confusing, though
> after some prodding I was not able to use this integer overflow to cause
> an under-allocated buffer.
> 
> Let's consistently use size_t to generarate and store these, and make
> sure our addition doesn't overflow.
nit: s/generarate/generate
-Stolee
Previous: Jeff KingNext: Jeff King
Message 5 of 8 in “harden tree-walking against integer overflow”
  1. 0/6 harden tree-walking against integer overflowJeff King, Jul 31, 2019
  2. 1/6 setup_traverse_info(): stop copying oidJeff King, Jul 31, 2019
  3. 2/6 tree-walk: drop oid from traverse_infoJeff King, Jul 31, 2019
  4. 3/6 tree-walk: use size_t consistentlyJeff King, Jul 31, 2019
  5. Derrick StoleeAug 1, 2019
  6. 4/6 tree-walk: accept a raw length for traverse_path_len()Jeff King, Jul 31, 2019
  7. 5/6 tree-walk: add a strbuf wrapper for make_traverse_path()Jeff King, Jul 31, 2019
  8. 6/6 tree-walk: harden make_traverse_path() length computationsJeff King, Jul 31, 2019

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.