test overlapping ignore patterns
[gitweb.git] / index-pack.c
index fe75332a9cd492fa109d07904de39f0eafa75c7e..60ed41a993bf9e213b7dfde5ff43528eff6b6252 100644 (file)
@@ -338,7 +338,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_
                        base_offset = (base_offset << 7) + (c & 127);
                }
                delta_base->offset = obj->idx.offset - base_offset;
-               if (delta_base->offset >= obj->idx.offset)
+               if (delta_base->offset <= 0 || delta_base->offset >= obj->idx.offset)
                        bad_object(obj->idx.offset, "delta base offset is out of bound");
                break;
        case OBJ_COMMIT: