From 568459bf5e97a4f61429e3bdd1f97b54b39a1383 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 5 Feb 2024 14:35:53 +0000 Subject: Always check the return value of `repo_read_object_file()` There are a couple of places in Git's source code where the return value is not checked. As a consequence, they are susceptible to segmentation faults. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- combine-diff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'combine-diff.c') diff --git a/combine-diff.c b/combine-diff.c index f90f442482..c5492809e9 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -338,6 +338,8 @@ static char *grab_blob(struct repository *r, free_filespec(df); } else { blob = repo_read_object_file(r, oid, &type, size); + if (!blob) + die(_("unable to read %s"), oid_to_hex(oid)); if (type != OBJ_BLOB) die("object '%s' is not a blob!", oid_to_hex(oid)); } -- cgit v1.2.3