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

Re: [PATCH 2/5] revert: make commit subjects in insn sheet optional

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Dec 9, 2011, 19:44 UTC
Message-ID
<CALkWK0ki1r5AqYb8qyGHUNupTAhCa2TKwVgkrCpLr+zo_pCy9g@mail.gmail.com>
In-Reply-To
<20111209193527.GD20913@elie.hsd1.il.comcast.net>
Hi,
Jonathan Nieder wrote:
Show 21 quoted lines
> Ramkumar Ramachandra wrote:
>> Jonathan Nieder wrote:
>>> Ramkumar Ramachandra wrote:
>
>>>> [...]
>>>> While at it, also fix a bug: currently, we use a commit-id-shaped
>>>> buffer to store the word after "pick" in '.git/sequencer/todo'.  This
>>>> is both wasteful and wrong because it places an artificial limit on
>>>> the line length.  Eliminate the need for the buffer altogether, and
>>>> add a test demonstrating this.
>>>
>>> Reading the above does not make it at all obvious that I should want
>>> to apply this patch because otherwise my prankster friend can cause my
>>> copy of git to crash or run arbitrary code by putting a long commit
>>
>> Working backwards:
>> get_sha1() is what will finally misbehave: how?
>
> Not sure what you're talking about.  I was saying that any commit that
> goes from "git can segfault in such-and-such circumstance" to "git no
> longer segfaults in that circumstance" should loudly proclaim so!

That's what I'm confused about: how can I make git misbehave (let alone segfault) after applying this commit? In the previous message, I was trying to work backwards to figure that out -- I clearly didn't get anywhere. In other words: what happens if an overly long (a length that doesn't fit into a size_t) line is present? How does strchrnul() behave? How do we work around this without imposing some kind of artificial hard limit?

Thanks.
-- Ram
Previous: Jonathan NiederNext: Jonathan Nieder
Message 9 of 23 in “Re-roll rr/revert-cherry-pick”
  1. 0/5 Re-roll rr/revert-cherry-pickRamkumar Ramachandra, Dec 7, 2011
  2. 1/5 revert: free msg in format_todo()Ramkumar Ramachandra, Dec 7, 2011
  3. Jonathan NiederDec 7, 2011
  4. 2/5 revert: make commit subjects in insn sheet optionalRamkumar Ramachandra, Dec 7, 2011
  5. Jonathan NiederDec 7, 2011
  6. Ramkumar RamachandraDec 9, 2011
  7. Ramkumar RamachandraDec 9, 2011
  8. Jonathan NiederDec 9, 2011
  9. Ramkumar RamachandraDec 9, 2011
  10. Jonathan NiederDec 9, 2011
  11. Ramkumar RamachandraDec 9, 2011
  12. 3/5 revert: simplify getting commit subject in format_todo()Ramkumar Ramachandra, Dec 7, 2011
  13. Jonathan NiederDec 7, 2011
  14. 4/5 revert: allow mixed pick and revert instructionsRamkumar Ramachandra, Dec 7, 2011
  15. Jonathan NiederDec 7, 2011
  16. Ramkumar RamachandraDec 9, 2011
  17. 5/5 revert: simplify communicating command-line argumentsRamkumar Ramachandra, Dec 7, 2011
  18. Jonathan NiederDec 7, 2011
  19. Jonathan NiederDec 7, 2011
  20. Ramkumar RamachandraDec 7, 2011
  21. Jonathan NiederDec 7, 2011
  22. Jonathan NiederDec 7, 2011
  23. Junio C HamanoDec 8, 2011

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.