[BUG] Segmentation fault in git v2.41.0.rc1
- From
- Tribo Dar <3bodar@gmail.com>
- Date
- May 24, 2023, 06:59 UTC
- Message-ID
- <CACJVABb8tvgXAowgtHLrC6Uau8Q03VRFu1m7K91SJwjvufqXYw@mail.gmail.com>
Running `git submodule update` after commenting out the url setting in both .gitmodules and the corresponding section for the submodule in .git/config results in a segmentation fault instead of a suitable error message.
The cause is `sub->url` being NULL here (actual segfault comes a couple calls further): https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/builtin/submodule--helper.c#L2027
Possibly relevant: a similar snippet is being properly protected against null-pointer dereferencing here: https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/builtin/submodule--helper.c#L1243