diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-04-14 01:28:50 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-14 01:28:50 +0300 |
commit | f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b (patch) | |
tree | 438da5de939da18d89f81e84f9ea55e4f8957981 /ref-filter.c | |
parent | 89b43f80a514aee58b662ad606e6352e03eaeee4 (diff) | |
parent | c6854508808dd32e3fc20c5b021c4064d25f6438 (diff) |
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"), |