Skip to content

Commit 4d4c8e0

Browse files
committed
Re-adding the "delta offset is zero" error case
1 parent ba59a4a commit 4d4c8e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pack.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,9 @@ int get_delta_base(
930930

931931
git_oid_fromraw(&oid, base_info);
932932
if ((entry = git_oidmap_get(p->idx_cache, &oid)) != NULL) {
933+
if (entry->offset == 0)
934+
return packfile_error("delta offset is zero");
935+
933936
*curpos += 20;
934937
*delta_base_out = entry->offset;
935938
return 0;
@@ -949,6 +952,9 @@ int get_delta_base(
949952
} else
950953
return packfile_error("unknown object type");
951954

955+
if (base_offset == 0)
956+
return packfile_error("delta offset is zero");
957+
952958
*delta_base_out = base_offset;
953959
return 0;
954960
}

0 commit comments

Comments
 (0)