From: Derrick Stolee <stolee@gmail.com>
To: Thomas Bachem via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>,
Jeff King <peff@peff.net>, Taylor Blau <me@ttaylorr.com>,
Patrick Steinhardt <ps@pks.im>,
Colin Hinton <colinlewishinton@gmail.com>,
Matt Hunter <m@lfurio.us>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Usman Akinyemi <usmanakinyemi202@gmail.com>,
Miklos Vajna <vmiklos@collabora.com>,
Junio C Hamano <gitster@pobox.com>,
Thomas Bachem <mail@thomasbachem.com>
Subject: Re: [PATCH 04/15] bundle-uri: handle NULL value for fetch.bundleCreationToken
Date: Mon, 9 Nov 2026 08:39:45 -0500 [thread overview]
Message-ID: <015c2692-0370-49d9-b055-d86301c8138e@gmail.com> (raw)
In-Reply-To: <4eb7085084b880f90705799d523ab554fd1cabd3.1794040968.git.gitgitgadget@gmail.com>
On 11/7/2026 3:42 AM, Thomas Bachem via GitGitGadget wrote:
> From: Thomas Bachem <mail@thomasbachem.com>
>
> A fetch.bundleCreationToken without a value makes "git fetch" and
> "git clone --bundle-uri" segfault when the bundle list uses the
> creationToken heuristic: fetch_bundles_by_token() passes the NULL
> value to sscanf().
>
> The function already treats a token that does not parse as 0, as if
> no bundles had been fetched before, so it downloads them and then
> stores the new token. Treat a missing value the same way.
I agree that this is the correct fallback.
> - if (sscanf(creationTokenStr, "%"PRIu64, &maxCreationToken) != 1)
> + if (!creationTokenStr ||
> + sscanf(creationTokenStr, "%"PRIu64, &maxCreationToken) != 1)
> maxCreationToken = 0;
Good.
> +test_expect_success 'fetch treats fetch.bundleCreationToken without a value as 0' '
> + test_when_finished "rm -rf token-without-value" &&
> + cat >bundle-list <<-EOF &&
> + [bundle]
> + version = 1
> + mode = all
> + heuristic = creationToken
> +
> + [bundle "bundle-1"]
> + uri = file://$(pwd)/clone-from/bundle-1.bundle
> + creationToken = 1
> + EOF
I looked at your patches out-of-order, and you have some later ones that
focus on this bundle list having bad values. However, the real test is
in the fetch:
> + git clone --no-local clone-from token-without-value &&
> + git -C token-without-value \
> + -c fetch.bundleURI="file://$(pwd)/bundle-list" \
> + -c fetch.bundleCreationToken fetch origin &&
Here, the local creation token is NULL and that causes the problem.
> + test_cmp_config -C token-without-value 1 fetch.bundlecreationtoken
> +'
> +
Thanks,
-Stolee
next prev parent reply other threads:[~2026-11-09 13:39 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 8:42 [PATCH 00/15] Fix segfaults on settings given without a value Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 01/15] rebase -i: handle NULL value for rebase.missingCommitsCheck Thomas Bachem via GitGitGadget
2026-11-09 15:07 ` Phillip Wood
2026-11-09 19:45 ` Junio C Hamano
2026-11-09 20:03 ` Thomas Bachem
2026-11-07 8:42 ` [PATCH 02/15] odb: handle NULL values for core.alternateRefs* config Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 03/15] add-patch: handle NULL value for color slots Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 04/15] bundle-uri: handle NULL value for fetch.bundleCreationToken Thomas Bachem via GitGitGadget
2026-11-09 13:39 ` Derrick Stolee [this message]
2026-11-07 8:42 ` [PATCH 05/15] grep: handle NULL value for grep.patternType Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 06/15] remote: handle NULL value for remote.<name>.tagOpt Thomas Bachem via GitGitGadget
2026-11-10 11:14 ` Phillip Wood
2026-11-07 8:42 ` [PATCH 07/15] blame: handle NULL values for color.blame.* config Thomas Bachem via GitGitGadget
2026-11-10 11:14 ` Phillip Wood
2026-11-07 8:42 ` [PATCH 08/15] merge: handle NULL value for branch.<name>.mergeOptions Thomas Bachem via GitGitGadget
2026-11-10 11:12 ` Phillip Wood
2026-11-10 16:53 ` Junio C Hamano
2026-11-11 14:47 ` Phillip Wood
2026-11-11 15:26 ` Ben Knoble
2026-11-11 17:50 ` Junio C Hamano
2026-11-07 8:42 ` [PATCH 09/15] remote: handle NULL value for remotes.<group> Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 10/15] setup: handle NULL value for safe.bareRepository Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 11/15] pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.pattern Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 12/15] scalar: handle NULL value for scalar.repo Thomas Bachem via GitGitGadget
2026-11-09 13:32 ` Derrick Stolee
2026-11-07 8:42 ` [PATCH 13/15] config: handle NULL value for remote URLs in hasconfig includes Thomas Bachem via GitGitGadget
2026-11-07 8:42 ` [PATCH 14/15] bundle-uri: handle NULL values in bundle lists Thomas Bachem via GitGitGadget
2026-11-09 13:36 ` Derrick Stolee
2026-11-07 8:42 ` [PATCH 15/15] config: handle NULL values when listing colors and expiry dates Thomas Bachem via GitGitGadget
2026-11-09 13:42 ` [PATCH 00/15] Fix segfaults on settings given without a value Derrick Stolee
2026-11-10 7:36 ` [PATCH v2 " Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 01/15] rebase -i: handle NULL value for rebase.missingCommitsCheck Thomas Bachem via GitGitGadget
2026-11-10 11:15 ` Phillip Wood
2026-11-10 7:36 ` [PATCH v2 02/15] odb: handle NULL values for core.alternateRefs* config Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 03/15] add-patch: handle NULL value for color slots Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 04/15] bundle-uri: handle NULL value for fetch.bundleCreationToken Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 05/15] grep: handle NULL value for grep.patternType Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 06/15] remote: handle NULL value for remote.<name>.tagOpt Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 07/15] blame: handle NULL values for color.blame.* config Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 08/15] merge: handle NULL value for branch.<name>.mergeOptions Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 09/15] remote: handle NULL value for remotes.<group> Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 10/15] setup: handle NULL value for safe.bareRepository Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 11/15] pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.pattern Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 12/15] scalar: handle NULL value for scalar.repo Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 13/15] config: handle NULL value for remote URLs in hasconfig includes Thomas Bachem via GitGitGadget
2026-11-10 7:36 ` [PATCH v2 14/15] bundle-uri: handle NULL values in bundle lists Thomas Bachem via GitGitGadget
2026-11-10 11:11 ` Phillip Wood
2026-11-10 15:03 ` Derrick Stolee
2026-11-10 7:36 ` [PATCH v2 15/15] config: handle NULL values when listing colors and expiry dates Thomas Bachem via GitGitGadget
2026-11-10 11:17 ` [PATCH v2 00/15] Fix segfaults on settings given without a value Phillip Wood
2026-11-10 20:38 ` Thomas Bachem
2026-11-11 22:49 ` [PATCH v3 " Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 01/15] rebase -i: handle NULL value for rebase.missingCommitsCheck Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 02/15] odb: handle NULL values for core.alternateRefs* config Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 03/15] add-patch: handle NULL value for color slots Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 04/15] bundle-uri: handle NULL value for fetch.bundleCreationToken Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 05/15] grep: handle NULL value for grep.patternType Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 06/15] remote: handle NULL value for remote.<name>.tagOpt Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 07/15] blame: handle NULL values for color.blame.* config Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 08/15] merge: handle NULL value for branch.<name>.mergeOptions Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 09/15] remote: handle NULL value for remotes.<group> Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 10/15] setup: handle NULL value for safe.bareRepository Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 11/15] pseudo-merge: handle NULL value for bitmapPseudoMerge.<name>.pattern Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 12/15] scalar: handle NULL value for scalar.repo Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 13/15] config: handle NULL value for remote URLs in hasconfig includes Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 14/15] bundle-uri: handle NULL values in bundle lists Thomas Bachem via GitGitGadget
2026-11-11 22:49 ` [PATCH v3 15/15] config: handle NULL values when listing colors and expiry dates Thomas Bachem via GitGitGadget
2026-11-12 14:25 ` [PATCH v3 00/15] Fix segfaults on settings given without a value Phillip Wood
2026-11-12 14:25 ` Derrick Stolee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=015c2692-0370-49d9-b055-d86301c8138e@gmail.com \
--to=stolee@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=colinlewishinton@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=m@lfurio.us \
--cc=mail@thomasbachem.com \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
--cc=phillip.wood@dunelm.org.uk \
--cc=ps@pks.im \
--cc=usmanakinyemi202@gmail.com \
--cc=vmiklos@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox