threads / discuss / 61582

builtin/stash - segmentation fault

Subject: builtin/stash - segmentation fault

## tl;dr

One message between Jun 4, 2024 and Jun 4, 2024.

replies: 0people: 1as markdown or json

Fadhil Mandaga· Jun 4, 2024, 07:12 UTC · lore
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.

← back to recent threads