Skip to content

Commit add8982

Browse files
dschogitster
authored andcommitted
fetch-pack: defensive programming
CodeQL points out that `parse_object()` can return NULL values. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f44f334 commit add8982

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
@@ -155,7 +155,7 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
155155
struct tag *tag = (struct tag *)
156156
parse_object(the_repository, oid);
157157

158-
if (!tag->tagged)
158+
if (!tag || !tag->tagged)
159159
return NULL;
160160
if (mark_tags_complete_and_check_obj_db)
161161
tag->object.flags |= COMPLETE;

0 commit comments

Comments
 (0)