]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-pack-objects.c
make overflow test on delta base offset work regardless of variable size
[thirdparty/git.git] / builtin-pack-objects.c
index 6bff17b130b6a4aa4cbde44164f4e56b5893975d..ee607a0d2c086d93d9d9f56453a4e79e397b4a20 100644 (file)
@@ -1014,7 +1014,7 @@ static void check_object(struct object_entry *entry)
                                ofs = c & 127;
                                while (c & 128) {
                                        ofs += 1;
-                                       if (!ofs || ofs & ~(~0UL >> 7))
+                                       if (!ofs || MSB(ofs, 7))
                                                die("delta base offset overflow in pack for %s",
                                                    sha1_to_hex(entry->sha1));
                                        c = buf[used_0++];