File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1499,6 +1499,7 @@ static int pack_entry_find_offset(
14991499 size_t len )
15001500{
15011501 const uint32_t * level1_ofs ;
1502+ size_t ofs_delta = 0 ;
15021503 const unsigned char * index ;
15031504 unsigned hi , lo , stride ;
15041505 int pos , found = 0 ;
@@ -1524,13 +1525,11 @@ static int pack_entry_find_offset(
15241525
15251526 if (p -> index_version > 1 ) {
15261527 level1_ofs += 2 ;
1528+ ofs_delta = 2 ;
15271529 index += 8 ;
1530+ }
15281531
1529- if ((int )short_oid -> id [0 ] + 2 >= p -> index_map .len ) {
1530- git_error_set (GIT_ERROR_INTERNAL , "internal error: p->short_oid->[0] out of bounds" );
1531- goto cleanup ;
1532- }
1533- } else if ((int )short_oid -> id [0 ] >= p -> index_map .len ) {
1532+ if ((size_t )short_oid -> id [0 ] + ofs_delta >= p -> index_map .len ) {
15341533 git_error_set (GIT_ERROR_INTERNAL , "internal error: p->short_oid->[0] out of bounds" );
15351534 goto cleanup ;
15361535 }
You can’t perform that action at this time.
0 commit comments