Skip to content

Commit 4cb0912

Browse files
committed
fetch-pack: defensive programming
CodeQL points out that `parse_object()` can return NULL values. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent aba0c0f commit 4cb0912

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fetch-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
157157
struct tag *tag = (struct tag *)
158158
parse_object(the_repository, oid);
159159

160-
if (!tag->tagged)
160+
if (!tag || !tag->tagged)
161161
return NULL;
162162
if (mark_tags_complete_and_check_obj_db)
163163
tag->object.flags |= COMPLETE;

0 commit comments

Comments
 (0)