git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG_REPORT] `git submodule update` segfaults

From
TDTribo Dar <3bodar@gmail.com>
Date
May 16, 2023, 08:23 UTC
Message-ID
<CACJVABb6s+dH8CPs1-OGgwRwgyRRSMnenLCenBScis=ADUUuDA@mail.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

Message 1 of 1 in “[BUG_REPORT] `git submodule update` segfaults”
  1. Tribo DarMay 16, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.