File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,7 +200,8 @@ static void pack_index_free(struct git_pack_file *p)
200200static int pack_index_check_locked (const char * path , struct git_pack_file * p )
201201{
202202 struct git_pack_idx_header * hdr ;
203- uint32_t version , nr , i , * index ;
203+ uint32_t version , i , * index ;
204+ uint64_t nr = 0 ;
204205 void * idx_map ;
205206 size_t idx_size ;
206207 struct stat st ;
@@ -246,7 +247,6 @@ static int pack_index_check_locked(const char *path, struct git_pack_file *p)
246247 version = 1 ;
247248 }
248249
249- nr = 0 ;
250250 index = idx_map ;
251251
252252 if (version > 1 )
@@ -287,8 +287,8 @@ static int pack_index_check_locked(const char *path, struct git_pack_file *p)
287287 * variable sized table containing 8-byte entries
288288 * for offsets larger than 2^31.
289289 */
290- unsigned long min_size = 8 + (4 * 256 ) + (nr * (p -> oid_size + 4 + 4 )) + (p -> oid_size * 2 );
291- unsigned long max_size = min_size ;
290+ uint64_t min_size = 8 + (4 * 256 ) + (nr * (p -> oid_size + 4 + 4 )) + (p -> oid_size * 2 );
291+ uint64_t max_size = min_size ;
292292
293293 if (nr )
294294 max_size += (nr - 1 )* 8 ;
You can’t perform that action at this time.
0 commit comments