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()`
This commit is contained in:
Junio C Hamano
2024-02-14 15:36:06 -08:00
6 changed files with 22 additions and 4 deletions

View File

@@ -973,6 +973,9 @@ static int handle_cache(struct index_state *istate,
mmfile[i].ptr = repo_read_object_file(the_repository,
&ce->oid, &type,
&size);
if (!mmfile[i].ptr)
die(_("unable to read %s"),
oid_to_hex(&ce->oid));
mmfile[i].size = size;
}
}