]> git.ipfire.org Git - thirdparty/git.git/commit
bundle-uri: avoid using undefined output of `sscanf()`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 15 May 2025 13:11:48 +0000 (13:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 May 2025 20:46:48 +0000 (13:46 -0700)
commitd7cfbd4351bb304eefc09a8b1ba24fd40a9f36a0
treef3d49f50941217a4b643accec310eed80783a783
parentee63d026b407118221aca455a9c4f03a08ecf648
bundle-uri: avoid using undefined output of `sscanf()`

In c429bed102 (bundle-uri: store fetch.bundleCreationToken, 2023-01-31)
code was introduced that assumes that an `sscanf()` call leaves its
output variables unchanged unless the return value indicates success.

However, the POSIX documentation makes no such guarantee:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sscanf.html

So let's make sure that the output variable `maxCreationToken` is
always well-defined.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle-uri.c