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

[PATCH 0/2] Sequencer: avoid use-after-free when creating merges

From
PGPhillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Date
May 9, 2025, 16:22 UTC
Message-ID
<pull.1919.git.1746807747.gitgitgadget@gmail.com>

This series fixes a use-after-free bug reported in [1]. The bug is caused by storing a pointer to the buffer in a static strbuf that gets reallocated. There was some discussion about removing the buffer and making the caller responsible for freeing the returned string. In the end I decided to keep the buffer as it avoids having to remember to free the return value and instead stop storing the pointer to it in a long-lived variable.

Many thanks to Kristoffer for the detailed bug report and backtrace.
[1] https://lore.kernel.org/git/20250428194048.149348-1-code@khaugsbakk.name
Phillip Wood (2):
  sequencer: move reflog message functions
  sequencer: rework reflog message handling
 sequencer.c              | 116 +++++++++++++++++++--------------------
 t/t3430-rebase-merges.sh |  11 +++-
 2 files changed, 67 insertions(+), 60 deletions(-)
base-commit: 4bbb303af69990ccd05fe3a2eb58a1ce036f8220
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1919%2Fphillipwood%2Fsequencer-explicit-reflog-message-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1919/phillipwood/sequencer-explicit-reflog-message-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1919
-- 
gitgitgadget
Next: Phillip Wood via GitGitGadget
Message 1 of 4 in “Sequencer: avoid use-after-free when creating merges”
  1. 0/2 Sequencer: avoid use-after-free when creating mergesPhillip Wood via GitGitGadget, May 9, 2025
  2. 1/2 sequencer: move reflog message functionsPhillip Wood via GitGitGadget, May 9, 2025
  3. 2/2 sequencer: rework reflog message handlingPhillip Wood via GitGitGadget, May 9, 2025
  4. Junio C HamanoMay 9, 2025

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.