Merge branch 'js/misc-fixes'
Assorted fixes for issues found with CodeQL. * js/misc-fixes: sequencer: stop pretending that an assignment is a condition bundle-uri: avoid using undefined output of `sscanf()` commit-graph: avoid using stale stack addresses trace2: avoid "futile conditional" Avoid redundant conditions fetch: avoid unnecessary work when there is no current branch has_dir_name(): make code more obvious upload-pack: rename `enum` to reflect the operation commit-graph: avoid malloc'ing a local variable fetch: carefully clear local variable's address after use commit: simplify code
This commit is contained in:
12
bundle-uri.c
12
bundle-uri.c
@@ -532,11 +532,13 @@ static int fetch_bundles_by_token(struct repository *r,
|
||||
*/
|
||||
if (!repo_config_get_value(r,
|
||||
"fetch.bundlecreationtoken",
|
||||
&creationTokenStr) &&
|
||||
sscanf(creationTokenStr, "%"PRIu64, &maxCreationToken) == 1 &&
|
||||
bundles.items[0]->creationToken <= maxCreationToken) {
|
||||
free(bundles.items);
|
||||
return 0;
|
||||
&creationTokenStr)) {
|
||||
if (sscanf(creationTokenStr, "%"PRIu64, &maxCreationToken) != 1)
|
||||
maxCreationToken = 0;
|
||||
if (bundles.items[0]->creationToken <= maxCreationToken) {
|
||||
free(bundles.items);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user