# [BUG_REPORT] `git submodule update` segfaults

1 messages from 2023-05-16 to 2023-05-16. Participants: Tribo Dar.
Thread: https://gitlist.dev/t/59748

## Tribo Dar, 2023-05-16 08:23

Subject: [BUG_REPORT] `git submodule update` segfaults
Message-ID: <CACJVABb6s+dH8CPs1-OGgwRwgyRRSMnenLCenBScis=ADUUuDA@mail.gmail.com>
URL: https://gitlist.dev/e/CACJVABb6s%2BdH8CPs1-OGgwRwgyRRSMnenLCenBScis%3DADUUuDA%40mail.gmail.com

```
What did you do before the bug happened? (Steps to reproduce your issue)
Ran `git submodule update` after commenting out the url field in both
.gitmodules and the corresponding section for the submodule in .git/config.

What did you expect to happen? (Expected behavior)
Graceful handling of the situation.

What happened instead? (Actual behavior)
Segmentation fault.

Anything else you want to add:
The segfault results from `sub->url` being NULL here (actual segfault
comes a couple calls further):
https://github.com/git/git/blob/0df2c180904f6b709766f9c24669a9d01543f915/builtin/submodule--helper.c#LL2027C1-L2027C1

Possibly relevant: a similar snippet being properly protected against
null-pointer dereferencing:
https://github.com/git/git/blob/0df2c180904f6b709766f9c24669a9d01543f915/builtin/submodule--helper.c#L1243

```
