builtin/stash - segmentation fault
- From
- Fadhil Mandaga <firodj@gmail.com>
- Date
- Jun 4, 2024, 07:12 UTC
- Message-ID
- <CADV-Dy+dU+t=MCy5mwrMZ7LBvOh0T1zKos=-YpNk0EzXZN78tw@mail.gmail.com>
Hi,
When `git stash` on detached HEAD I got a segmentation fault. I am using git 2.45.2 on OSX/Darwin. Furthermore the culprit is EXC_BAD_ACCESS on `repo_find_unique_abbrev_r` because `oid` is invalid. The `oid` was obtained from NULL `lookup_commit` in `do_create_stash`. The result from `lookup_commit` should be checked for validation to avoid null access.
https://github.com/git/git/blob/7b0defb3915eaa0bd118f0996e8c00b4eb2dc1ca/builtin/stash.c#L1380
Thanks.