]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_file.c
make overflow test on delta base offset work regardless of variable size
[thirdparty/git.git] / sha1_file.c
index d9ca69a916f9a9699deb7d9972a0c6f491755f9d..ebdd497badf21abd599ad50607c957c177f993f8 100644 (file)
@@ -1150,7 +1150,7 @@ static off_t get_delta_base(struct packed_git *p,
                base_offset = c & 127;
                while (c & 128) {
                        base_offset += 1;
-                       if (!base_offset || base_offset & ~(~0UL >> 7))
+                       if (!base_offset || MSB(base_offset, 7))
                                die("offset value overflow for delta base object");
                        c = base_info[used++];
                        base_offset = (base_offset << 7) + (c & 127);