[PATCH 00/11] coverity: avoid dereferencing NULL
From: Johannes Schindelin via GitGitGadget <hidden>
Date: 2026-07-09 09:42:41
This is a continuation of the effort I started in the patch series that became js/coverity-fixes. This next batch adds guards to avoid dereferencing NULL pointers and accessing NULL file descriptors. Johannes Schindelin (11): diffcore-break: guard against NULLed queue entries in merge loop diff: handle NULL return from repo_get_commit_tree() remote: guard `remote_tracking()` against NULL remote reftable/stack: guard against NULL list_file in stack_destroy mailsplit: move NULL check before first use of file handle bisect: handle NULL commit in `bisect_successful()` replay: die when --onto does not peel to a commit revision: avoid dereferencing NULL in `add_parents_only()` pack-bitmap: handle missing bitmap for base MIDX bisect: ensure non-NULL `head` before using it shallow: fix NULL dereference builtin/bisect.c | 9 ++++++++- builtin/diff.c | 10 +++++++--- builtin/mailsplit.c | 6 +++--- diffcore-break.c | 2 ++ pack-bitmap.c | 4 ++++ reftable/stack.c | 3 ++- remote.c | 2 ++ replay.c | 8 ++++++-- revision.c | 9 +++++++-- shallow.c | 2 +- 10 files changed, 42 insertions(+), 13 deletions(-) base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2174%2Fdscho%2Fcoverity-fixes-null-safety-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2174/dscho/coverity-fixes-null-safety-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/2174 -- gitgitgadget