Re: [BUG] git stash show -p with invalid option aborts with double-free in show_stash() (strvec_clear)
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Sep 19, 2025, 13:11 UTC
- Message-ID
- <1321ff39-6f09-426a-aa75-939ef4e1ad93@app.fastmail.com>
- In-Reply-To
- <CAMCKZdV+ASXAhYXaTdtB=7YZprCxFUjwEsqQP7i_ccOwx8Lo6Q@mail.gmail.com>
On Fri, Sep 19, 2025, at 12:18, Lauri Niskanen wrote:
Show 23 quoted lines
> What did you do before the bug happened? > > Create a repo and a stash entry, then invoke `git stash show -p` with > an invalid option: > > git init repro > cd repro > touch a > git add a > git commit -m init > echo x >> a > git stash > git stash show -p --invalid > > > What did you expect to happen? > > Git should print a usage / option error and exit cleanly without crashing. > > > What happened instead? > > free(): double free detected in tcache 2
This bisects to 748bd094 (builtin/stash: fix leak in `show_stash()`, 2024-06-11) for me.
> GDB backtrace: >[snip]
-- Kristoffer Haugsbakk