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

Re: git config set --file, key-value pair without '= value', gives Segmentation fault

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2024, 01:28 UTC
Message-ID
<xmqq1q39yqsy.fsf@gitster.g>
In-Reply-To
<ZqrKeG+alFldB7OY@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> I tried to match the behavior a few lines down in that function, where
> we only call regexec() if value is non-NULL.

Yes, that is exactly what made me question the code. With the current code, valueless true cannot be updated with "--value" restriction, ever, because it will never match anything.

In any case, the patch is a strict improvement over the current code that segfaults. Making it aware of "--type=bool" and have it treat synonymous values of true/false properly would be better left as a follow-up topic.

Thanks.
Previous: Han Jiang
Message 6 of 6 in “git config set --file, key-value pair without '= value', gives Segmentation fault”
  1. Han JiangJul 31, 2024
  2. Taylor BlauJul 31, 2024
  3. Junio C HamanoJul 31, 2024
  4. Taylor BlauJul 31, 2024
  5. Han JiangJul 31, 2024
  6. Junio C HamanoAug 1, 2024

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.