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

Re: [PATCH 2/2] entry.c: fix possible buffer overflow in remove_subtree()

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 13, 2014, 11:29 UTC
Message-ID
<CACsJy8D9FrsZ0FmXZoXGGzqQK7UfE+K39259TjUkTOZp+F5OOA@mail.gmail.com>
In-Reply-To
<1394702348-6433-3-git-send-email-mhagger@alum.mit.edu>
On Thu, Mar 13, 2014 at 4:19 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> remove_subtree() manipulated path in a fixed-size buffer even though
> the length of the input, let alone the length of entries within the
> directory, were not known in advance.  Change the function to take a
> strbuf argument and use that object as its scratch space.

Converting more PATH_MAX to strbuf could be a micro project. Not sure if we still any more of them though.

The patches look fine btw.
-- 
Duy
Previous: Michael HaggertyNext: Jeff King
Message 5 of 6 in “Fix possible buffer overflow in remove_subtree()”
  1. 0/2 Fix possible buffer overflow in remove_subtree()Michael Haggerty, Mar 13, 2014
  2. 1/2 checkout_entry(): use the strbuf throughout the functionMichael Haggerty, Mar 13, 2014
  3. Duy NguyenMar 13, 2014
  4. 2/2 entry.c: fix possible buffer overflow in remove_subtree()Michael Haggerty, Mar 13, 2014
  5. Duy NguyenMar 13, 2014
  6. Jeff KingMar 13, 2014

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.