summaryrefslogtreecommitdiffstats
path: root/bisect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-15 00:36:06 +0100
committerJunio C Hamano <gitster@pobox.com>2024-02-15 00:36:06 +0100
commitc59ba68ea7d1b4614fa964403a6c662dca0dd212 (patch)
treeba54ccb735bf678d57407f9053f179867cc038f5 /bisect.c
parentMerge branch 'rs/receive-pack-remove-find-header' (diff)
parentAlways check the return value of `repo_read_object_file()` (diff)
downloadgit-c59ba68ea7d1b4614fa964403a6c662dca0dd212.tar.xz
git-c59ba68ea7d1b4614fa964403a6c662dca0dd212.zip
Merge branch 'js/check-null-from-read-object-file'
The code paths that call repo_read_object_file() have been tightened to react to errors. * js/check-null-from-read-object-file: Always check the return value of `repo_read_object_file()`
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bisect.c b/bisect.c
index f1273c787d..f75e50c339 100644
--- a/bisect.c
+++ b/bisect.c
@@ -158,6 +158,9 @@ static void show_list(const char *debug, int counted, int nr,
const char *subject_start;
int subject_len;
+ if (!buf)
+ die(_("unable to read %s"), oid_to_hex(&commit->object.oid));
+
fprintf(stderr, "%c%c%c ",
(commit_flags & TREESAME) ? ' ' : 'T',
(commit_flags & UNINTERESTING) ? 'U' : ' ',