Merge branch 'ew/commit-reach-clean-up-flags-fix'

Fix a segfaulting loop.  The function and its caller may need
further clean-up.

* ew/commit-reach-clean-up-flags-fix:
  commit-reach: avoid NULL dereference
This commit is contained in:
Junio C Hamano 2023-03-19 15:03:10 -07:00
commit b0d2440442

View File

@ -809,8 +809,12 @@ cleanup:
clear_commit_marks_many(nr_commits, list, RESULT | assign_flag);
free(list);
for (i = 0; i < from->nr; i++)
from->objects[i].item->flags &= ~assign_flag;
for (i = 0; i < from->nr; i++) {
struct object *from_one = from->objects[i].item;
if (from_one)
from_one->flags &= ~assign_flag;
}
return result;
}