diff options
| author | Colin Stolley <ccstolley@github.com> | 2022-05-19 16:33:57 -0500 |
|---|---|---|
| committer | Colin Stolley <ccstolley@github.com> | 2022-05-20 14:00:18 -0500 |
| commit | 8a765c72a850641b35c6ee7800524664920b7496 (patch) | |
| tree | 52c2ac2361727f7b2a1fa14573c43ec514d1f3b3 /src | |
| parent | bdab22384cc61d315005a65456a9f9563bb27c8f (diff) | |
| download | libgit2-8a765c72a850641b35c6ee7800524664920b7496.tar.gz | |
midx: fix large object offset table check.
It's insufficient to only check if the offset high order bit is set, we
must also check to see if object_large_offsets are in use.
This bug is causing objects to appear missing because they can't be
found in the index.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libgit2/midx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libgit2/midx.c b/src/libgit2/midx.c index d4e53c421..b2f22614f 100644 --- a/src/libgit2/midx.c +++ b/src/libgit2/midx.c @@ -431,7 +431,7 @@ int git_midx_entry_find( object_offset = idx->object_offsets + pos * 8; offset = ntohl(*((uint32_t *)(object_offset + 4))); - if (offset & 0x80000000) { + if (idx->object_large_offsets && offset & 0x80000000) { uint32_t object_large_offsets_pos = offset & 0x7fffffff; const unsigned char *object_large_offsets_index = idx->object_large_offsets; |
