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

Re: [PATCH v3 00/15] Fix segfaults on settings given without a value

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Nov 12, 2026, 14:25 UTC
Message-ID
<f04be044-96a7-40e5-9fb9-81bde0e3dc04@gmail.com>
In-Reply-To
<pull.2297.v3.git.1794437355.gitgitgadget@gmail.com>
Hi Thomas
On 11/11/2026 22:49, Thomas Bachem via GitGitGadget wrote:
Show 6 quoted lines
> Changes since v2:
> >   * Where an invalid value is ignored, a missing one now is too, with a
>     warning: remote.*.tagOpt (patch 6) and color.blame.repeatedLines (patch
>     7). v2 rejected them (Phillip).
> >   * The test in patch 1 rebases onto HEAD~3 and checks the result with
>     test_commit_message (Phillip).
That sounds good, and the range-diff below looks as I'd expect. Thanks for working on this, as far as I'm concerned it is ready for next.
Phillip
Show 114 quoted lines
> Range-diff vs v2:
> >    1:  47224a9893 !  1:  1262222ccd rebase -i: handle NULL value for rebase.missingCommitsCheck
>       @@ t/t3404-rebase-interactive.sh: test_expect_success 'rebase -i respects rebase.mi
>        +	rebase_setup_and_clean missing-commit &&
>        +	(
>        +		set_fake_editor &&
>       -+		FAKE_LINES="1 2 3 4" \
>       -+			git -c rebase.missingCommitsCheck rebase -i --root 2>actual
>       ++		FAKE_LINES=1 \
>       ++			git -c rebase.missingCommitsCheck rebase -i HEAD~3 2>actual
>        +	) &&
>       -+	test D = $(git cat-file commit HEAD | sed -ne \$p) &&
>       ++	test_commit_message HEAD -m C &&
>        +	test_grep "missing value for option rebase.missingCommitsCheck" actual &&
>        +	test_grep ! "commits may have been dropped" actual
>        +'
>    2:  9170c4162f =  2:  ec9d7fd183 odb: handle NULL values for core.alternateRefs* config
>    3:  d3fd6290e0 =  3:  c071e79d11 add-patch: handle NULL value for color slots
>    4:  a822cbb844 =  4:  8773aaef0b bundle-uri: handle NULL value for fetch.bundleCreationToken
>    5:  6c2a671a92 =  5:  123f03f024 grep: handle NULL value for grep.patternType
>    6:  d4b49d1363 !  6:  339590cd4b remote: handle NULL value for remote.<name>.tagOpt
>       @@ Commit message
>            "git remote" and "git status" segfault: handle_config() passes the
>            NULL value to strcmp().
>        >       -    Reject a missing value with config_error_nonbool(), as handle_config()
>       -    already does for remote.<name>.url and remote.<name>.pushurl.
>       +    The setting takes "--no-tags" or "--tags", and any other value is
>       +    ignored. Ignore a missing value too, but warn about it.
>        >       +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>            Assisted-by: Claude Fable 5.1
>       +    Assisted-by: Claude Opus 5.5
>            Signed-off-by: Thomas Bachem <mail@thomasbachem.com>
>        >         ## remote.c ##
>       @@ remote.c: static int handle_config(const char *key, const char *value,
>         		else
>         			error(_("more than one uploadpack given, using the first"));
>         	} else if (!strcmp(subkey, "tagopt")) {
>       -+		if (!value)
>       -+			return config_error_nonbool(key);
>       ++		if (!value) {
>       ++			warning(_("missing value for '%s'"), key);
>       ++			return 0;
>       ++		}
>         		if (!strcmp(value, "--no-tags"))
>         			remote->fetch_tags = -1;
>         		else if (!strcmp(value, "--tags"))
>       @@ t/t5505-remote.sh: test_expect_success 'remote information for the origin' '
>         	)
>         '
>         >       -+test_expect_success 'tagOpt needs a value' '
>       -+	test_must_fail git -C test -c remote.origin.tagOpt remote 2>err &&
>       ++test_expect_success 'tagOpt without a value only warns' '
>       ++	git -C test -c remote.origin.tagOpt remote >actual 2>err &&
>       ++	echo origin >expect &&
>       ++	test_cmp expect actual &&
>        +	test_grep "missing value for .remote.origin.tagopt." err
>        +'
>        +
>    7:  25843b43bf !  7:  ad50c4b35b blame: handle NULL values for color.blame.* config
>       @@ Commit message
>            value makes "git blame" segfault: git_blame_config() passes the NULL
>            value to strlen() or to parse_color_fields().
>        >       -    Reject a missing value with config_error_nonbool(), as
>       +    An invalid color.blame.repeatedLines gets a warning and is ignored.
>       +    Treat a missing value the same way.
>       +
>       +    An invalid color.blame.highlightRecent makes "git blame" die, so
>       +    reject a missing value there with config_error_nonbool(), as
>            git_blame_config() already does for blame.date and blame.coloring.
>        >       +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>            Assisted-by: Claude Fable 5.1
>       +    Assisted-by: Claude Opus 5.5
>            Signed-off-by: Thomas Bachem <mail@thomasbachem.com>
>        >         ## builtin/blame.c ##
>       @@ builtin/blame.c: static int git_blame_config(const char *var, const char *value,
>         		return 0;
>         	}
>         	if (!strcmp(var, "color.blame.repeatedlines")) {
>       -+		if (!value)
>       -+			return config_error_nonbool(var);
>       ++		if (!value) {
>       ++			warning(_("missing value for '%s'"),
>       ++				"color.blame.repeatedLines");
>       ++			return 0;
>       ++		}
>         		if (color_parse_mem(value, strlen(value), repeated_meta_color))
>         			warning(_("invalid value for '%s': '%s'"),
>         				"color.blame.repeatedLines", value);
>       @@ t/t8012-blame-colors.sh: test_expect_success 'blame color by age: new code is di
>         	test_grep qfunc colored
>         '
>         >       -+test_expect_success 'color.blame.repeatedLines and highlightRecent need a value' '
>       -+	test_must_fail git -c color.blame.repeatedLines blame hello.c 2>err &&
>       -+	test_grep "missing value for .color.blame.repeatedlines." err &&
>       ++test_expect_success 'color.blame.repeatedLines without a value only warns' '
>       ++	git blame --color-lines hello.c >expect &&
>       ++	git -c color.blame.repeatedLines blame --color-lines hello.c >actual 2>err &&
>       ++	test_cmp expect actual &&
>       ++	test_grep "missing value for .color.blame.repeatedLines." err
>       ++'
>       ++
>       ++test_expect_success 'color.blame.highlightRecent needs a value' '
>        +	test_must_fail git -c color.blame.highlightRecent blame hello.c 2>err &&
>        +	test_grep "missing value for .color.blame.highlightrecent." err
>        +'
>    8:  d8681a8560 =  8:  90209dc754 merge: handle NULL value for branch.<name>.mergeOptions
>    9:  51f8eba073 =  9:  f30ecf07b4 remote: handle NULL value for remotes.<group>
>   10:  a5b6436943 = 10:  bb6eecd20c setup: handle NULL value for safe.bareRepository
>   11:  1533ef9cc6 = 11:  510dc56c9b pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.pattern
>   12:  6219e9fd7f = 12:  751fae34b2 scalar: handle NULL value for scalar.repo
>   13:  080106d5ea = 13:  4d5d2ce04e config: handle NULL value for remote URLs in hasconfig includes
>   14:  fb9e63541b = 14:  474aebd572 bundle-uri: handle NULL values in bundle lists
>   15:  12f841e5ff = 15:  f6f3295ff5 config: handle NULL values when listing colors and expiry dates
> 
Previous: Thomas Bachem via GitGitGadgetNext: Derrick Stolee
Message 68 of 70 in “Fix segfaults on settings given without a value”
  1. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 7, 2026
  2. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 7, 2026
  3. Phillip WoodNov 9, 2026
  4. Junio C HamanoNov 9, 2026
  5. Thomas BachemNov 9, 2026
  6. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 7, 2026
  7. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 7, 2026
  8. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 7, 2026
  9. Derrick StoleeNov 9, 2026
  10. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 7, 2026
  11. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 7, 2026
  12. Phillip WoodNov 10, 2026
  13. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 7, 2026
  14. Phillip WoodNov 10, 2026
  15. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 7, 2026
  16. Phillip WoodNov 10, 2026
  17. Junio C HamanoNov 10, 2026
  18. Phillip WoodNov 11, 2026
  19. Ben KnobleNov 11, 2026
  20. Junio C HamanoNov 11, 2026
  21. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 7, 2026
  22. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 7, 2026
  23. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 7, 2026
  24. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 7, 2026
  25. Derrick StoleeNov 9, 2026
  26. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 7, 2026
  27. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 7, 2026
  28. Derrick StoleeNov 9, 2026
  29. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 7, 2026
  30. Derrick StoleeNov 9, 2026
  31. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 10, 2026
  32. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 10, 2026
  33. Phillip WoodNov 10, 2026
  34. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 10, 2026
  35. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 10, 2026
  36. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 10, 2026
  37. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 10, 2026
  38. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 10, 2026
  39. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 10, 2026
  40. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 10, 2026
  41. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 10, 2026
  42. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 10, 2026
  43. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 10, 2026
  44. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 10, 2026
  45. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 10, 2026
  46. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 10, 2026
  47. Phillip WoodNov 10, 2026
  48. Derrick StoleeNov 10, 2026
  49. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 10, 2026
  50. Phillip WoodNov 10, 2026
  51. Thomas BachemNov 10, 2026
  52. 00/15 Fix segfaults on settings given without a valueThomas Bachem via GitGitGadget, Nov 11, 2026
  53. 01/15 rebase -i: handle NULL value for rebase.missingCommitsCheckThomas Bachem via GitGitGadget, Nov 11, 2026
  54. 02/15 odb: handle NULL values for core.alternateRefs* configThomas Bachem via GitGitGadget, Nov 11, 2026
  55. 03/15 add-patch: handle NULL value for color slotsThomas Bachem via GitGitGadget, Nov 11, 2026
  56. 04/15 bundle-uri: handle NULL value for fetch.bundleCreationTokenThomas Bachem via GitGitGadget, Nov 11, 2026
  57. 05/15 grep: handle NULL value for grep.patternTypeThomas Bachem via GitGitGadget, Nov 11, 2026
  58. 06/15 remote: handle NULL value for remote.<name>.tagOptThomas Bachem via GitGitGadget, Nov 11, 2026
  59. 07/15 blame: handle NULL values for color.blame.* configThomas Bachem via GitGitGadget, Nov 11, 2026
  60. 08/15 merge: handle NULL value for branch.<name>.mergeOptionsThomas Bachem via GitGitGadget, Nov 11, 2026
  61. 09/15 remote: handle NULL value for remotes.<group>Thomas Bachem via GitGitGadget, Nov 11, 2026
  62. 10/15 setup: handle NULL value for safe.bareRepositoryThomas Bachem via GitGitGadget, Nov 11, 2026
  63. 11/15 pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.patternThomas Bachem via GitGitGadget, Nov 11, 2026
  64. 12/15 scalar: handle NULL value for scalar.repoThomas Bachem via GitGitGadget, Nov 11, 2026
  65. 13/15 config: handle NULL value for remote URLs in hasconfig includesThomas Bachem via GitGitGadget, Nov 11, 2026
  66. 14/15 bundle-uri: handle NULL values in bundle listsThomas Bachem via GitGitGadget, Nov 11, 2026
  67. 15/15 config: handle NULL values when listing colors and expiry datesThomas Bachem via GitGitGadget, Nov 11, 2026
  68. Phillip WoodNov 12, 2026
  69. Derrick StoleeNov 12, 2026
  70. Junio C HamanoNov 12, 2026

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.