File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -934,19 +934,19 @@ git_off_t get_delta_base(
934934 if (type == GIT_OBJ_OFS_DELTA ) {
935935 unsigned used = 0 ;
936936 unsigned char c = base_info [used ++ ];
937- base_offset = c & 127 ;
937+ size_t unsigned_base_offset = c & 127 ;
938938 while (c & 128 ) {
939939 if (left <= used )
940940 return GIT_EBUFS ;
941- base_offset += 1 ;
942- if (!base_offset || MSB (base_offset , 7 ))
941+ unsigned_base_offset += 1 ;
942+ if (!unsigned_base_offset || MSB (unsigned_base_offset , 7 ))
943943 return 0 ; /* overflow */
944944 c = base_info [used ++ ];
945- base_offset = (base_offset << 7 ) + (c & 127 );
945+ unsigned_base_offset = (unsigned_base_offset << 7 ) + (c & 127 );
946946 }
947- base_offset = delta_obj_offset - base_offset ;
948- if (base_offset <= 0 || base_offset >= delta_obj_offset )
947+ if (unsigned_base_offset == 0 || (size_t )delta_obj_offset <= unsigned_base_offset )
949948 return 0 ; /* out of bound */
949+ base_offset = delta_obj_offset - unsigned_base_offset ;
950950 * curpos += used ;
951951 } else if (type == GIT_OBJ_REF_DELTA ) {
952952 /* If we have the cooperative cache, search in it first */
You can’t perform that action at this time.
0 commit comments