diff options
author | lhchavez <lhchavez@lhchavez.com> | 2020-04-02 07:34:55 -0700 |
---|---|---|
committer | lhchavez <lhchavez@lhchavez.com> | 2020-04-02 07:34:55 -0700 |
commit | 4d4c8e0a3dd9af6a14228686333d3d2098c86b04 (patch) | |
tree | f13659f809f9ba122caeedd6556bc1c067e6e74c | |
parent | ba59a4a2cc5c3ceec41ef92ea6bd60f28cae205f (diff) | |
download | libgit2-4d4c8e0a3dd9af6a14228686333d3d2098c86b04.tar.gz |
Re-adding the "delta offset is zero" error case
-rw-r--r-- | src/pack.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pack.c b/src/pack.c index e0b2c78b6..4294a6e32 100644 --- a/src/pack.c +++ b/src/pack.c @@ -930,6 +930,9 @@ int get_delta_base( git_oid_fromraw(&oid, base_info); if ((entry = git_oidmap_get(p->idx_cache, &oid)) != NULL) { + if (entry->offset == 0) + return packfile_error("delta offset is zero"); + *curpos += 20; *delta_base_out = entry->offset; return 0; @@ -949,6 +952,9 @@ int get_delta_base( } else return packfile_error("unknown object type"); + if (base_offset == 0) + return packfile_error("delta offset is zero"); + *delta_base_out = base_offset; return 0; } |