git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Sequencer: avoid use-after-free when creating merges
@ 2025-05-09 16:22 Phillip Wood via GitGitGadget
  2025-05-09 16:22 ` [PATCH 1/2] sequencer: move reflog message functions Phillip Wood via GitGitGadget
  2025-05-09 16:22 ` [PATCH 2/2] sequencer: rework reflog message handling Phillip Wood via GitGitGadget
  0 siblings, 2 replies; 4+ messages in thread
From: Phillip Wood via GitGitGadget @ 2025-05-09 16:22 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, Jeff King, Phillip Wood

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-09 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 16:22 [PATCH 0/2] Sequencer: avoid use-after-free when creating merges Phillip Wood via GitGitGadget
2025-05-09 16:22 ` [PATCH 1/2] sequencer: move reflog message functions Phillip Wood via GitGitGadget
2025-05-09 16:22 ` [PATCH 2/2] sequencer: rework reflog message handling Phillip Wood via GitGitGadget
2025-05-09 20:37   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).