Unverified Commit 6bd024aa by Edward Thomson Committed by GitHub

Merge pull request #6309 from ccstolley/ccs_fix_midx_offset

midx: fix large offset table check.
parents 11b81717 97954ee5
...@@ -431,8 +431,8 @@ int git_midx_entry_find( ...@@ -431,8 +431,8 @@ int git_midx_entry_find(
object_offset = idx->object_offsets + pos * 8; object_offset = idx->object_offsets + pos * 8;
offset = ntohl(*((uint32_t *)(object_offset + 4))); 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; uint32_t object_large_offsets_pos = (uint32_t) (offset ^ 0x80000000);
const unsigned char *object_large_offsets_index = idx->object_large_offsets; const unsigned char *object_large_offsets_index = idx->object_large_offsets;
/* Make sure we're not being sent out of bounds */ /* Make sure we're not being sent out of bounds */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment