Skip to content

CodeQL-inspired fixes

Johannes Schindelin via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11commit: simplify codebuiltin/commit.c+1 -13 replies
2/11fetch: carefully clear local variable's address after usebuiltin/fetch.c+1 -01 reply
3/11commit-graph: avoid malloc'ing a local variablecommit-graph.c+69 -722 replies
4/11upload-pack: rename `enum` to reflect the operationupload-pack.c+17 -171 reply
5/11has_dir_name(): make code more obviousread-cache.c+13 -421 reply
6/11fetch: avoid unnecessary work when there is no current branchbuiltin/fetch.c+1 -11 reply
7/11Avoid redundant conditionshelp.c transport-helper.c+2 -21 reply
8/11trace2: avoid "futile conditional"trace2/tr2_tmr.c+5 -191 reply
9/11commit-graph: avoid using stale stack addressescommit-graph.c+9 -01 reply
10/11bundle-uri: avoid using undefined output of `sscanf()`bundle-uri.c+7 -57 replies
11/11sequencer: stop pretending that an assignment is a conditionsequencer.c+6 -33 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] CodeQL-inspired fixes

CodeQL [https://codeql.github.com/] pointed out a couple of issues, which are addressed in this patch series.

Johannes Schindelin (11):
commit: simplify code
fetch: carefully clear local variable's address after use
commit-graph: avoid malloc'ing a local variable
upload-pack: rename enum to reflect the operation has_dir_name(): make code more obvious
fetch: avoid unnecessary work when there is no current branch Avoid redundant conditions
trace2: avoid "futile conditional"
commit-graph: avoid using stale stack addresses
bundle-uri: avoid using undefined output of sscanf()
sequencer: stop pretending that an assignment is a condition

 builtin/commit.c   |   2 +-
 builtin/fetch.c    |   3 +-
 bundle-uri.c       |  12 ++--
 commit-graph.c     | 148 +++++++++++++++++++++++----------------------
 help.c             |   2 +-
 read-cache.c       |  55 ++++-------------
 sequencer.c        |   9 ++-
 trace2/tr2_tmr.c   |  24 ++------
 transport-helper.c |   2 +-
 upload-pack.c      |  34 +++++------
 10 files changed, 130 insertions(+), 161 deletions(-)

base-commit: 38af977b81bbf8ce8c0004d3f4046a823ecb30a1
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1891%2Fdscho%2Fcodeql-fixes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1891/dscho/codeql-fixes-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1891

Signature · 1 line
gitgitgadget