diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-04-13 15:28:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-13 15:28:50 -0700 |
commit | f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b (patch) | |
tree | 438da5de939da18d89f81e84f9ea55e4f8957981 /ref-filter.c | |
parent | The eighth batch (diff) | |
parent | ref-filter: fix NULL check for parse object failure (diff) | |
download | tgif-f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b.tar.xz |
Merge branch 'jk/ref-filter-segfault-fix'
A NULL-dereference bug has been corrected in an error codepath in
"git for-each-ref", "git branch --list" etc.
* jk/ref-filter-segfault-fix:
ref-filter: fix NULL check for parse object failure
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c index f0bd32f714..a0adb4551d 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1608,7 +1608,7 @@ static int get_object(struct ref_array_item *ref, int deref, struct object **obj if (oi->info.contentp) { *obj = parse_object_buffer(the_repository, &oi->oid, oi->type, oi->size, oi->content, &eaten); - if (!obj) { + if (!*obj) { if (!eaten) free(oi->content); return strbuf_addf_ret(err, -1, _("parse_object_buffer failed on %s for %s"), |