From c77722b3ea42a87381915f1203648a5f5d86c1ff Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Thu, 5 Sep 2019 21:59:42 +0200 Subject: use get_tagged_oid() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid derefencing ->tagged without checking for NULL by using the convenience wrapper for getting the ID of the tagged object. It die()s when encountering a broken tag instead of segfaulting. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- packfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packfile.c') diff --git a/packfile.c b/packfile.c index fc43a6c52c..a62ab4cb17 100644 --- a/packfile.c +++ b/packfile.c @@ -2139,7 +2139,7 @@ static int add_promisor_object(const struct object_id *oid, oidset_insert(set, &parents->item->object.oid); } else if (obj->type == OBJ_TAG) { struct tag *tag = (struct tag *) obj; - oidset_insert(set, &tag->tagged->oid); + oidset_insert(set, get_tagged_oid(tag)); } return 0; } -- cgit v1.3