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

Re: [PATCH] Don't segfault if the given SHA1 name is longer than 40 characters

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 19, 2006, 04:54 UTC
Message-ID
<fcaeb9bf0610182154l55de75d1w4a99db608f7f6477@mail.gmail.com>
In-Reply-To
<7vwt6xvt7q.fsf@assigned-by-dhcp.cox.net>
On 10/19/06, Junio C Hamano <junkio@cox.net> wrote:
> The patch is correct, but it needs a better explanation in the
> proposed commit log message than just "Don't segfault".

Well, maybe because I got a segfault when I accidentally pasted an sha1 twice (blame my mouse). I hadn't looked closely enough to the bug. Anyway, you got the bug and obviously have a better explanation than mine. Please fix it with a better explanation. I'll be more explanatory next time. Thank you :-)

Show 8 quoted lines
> get_describe_name() can be fed a string foo-gXXX...XXX with a
> very looooooooong hexstring.  It calls get_short_sha1() without
> checking if XXX...XXX part is longer than 40-bytes (in which
> case it cannot be a valid object name).
>
> get_sha1_1() has the same problem.  Given a hexstring longer
> than 40-bytes, it calls the function with it because earlier
> ones such as get_sha1_hex() would reject the input.
-- 
Duy
Previous: Junio C Hamano
Message 3 of 3 in “Don't segfault if the given SHA1 name is longer than 40 characters”
  1. Don't segfault if the given SHA1 name is longer than 40 characterspclouds@gmail.com, Oct 19, 2006
  2. Junio C HamanoOct 19, 2006
  3. Nguyen Thai Ngoc DuyOct 19, 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.