On Tue, 17 Oct 2006, Junio C Hamano wrote: > Sergey Vlasov <vsu@xxxxxxxxxxx> writes: > > > On Tue, 17 Oct 2006 14:47:16 -0400 (EDT) Nicolas Pitre wrote: > > > >> Is it possible that sizeof(union delta_base) might not be equal to 20 > >> for you? > > > > Yes, on x86_64 this is 24 because of 8-byte alignment for longs: > > Enough eyeballs made this bug shallow ;-) Thanks. > > diff --git a/index-pack.c b/index-pack.c > index fffddd2..49b6efe 100644 > --- a/index-pack.c > +++ b/index-pack.c > @@ -166,6 +166,7 @@ static void *unpack_raw_entry(unsigned l > case OBJ_REF_DELTA: > if (pos + 20 >= pack_limit) > bad_object(offset, "object extends past end of pack"); > + memset(delta_base, 0, sizeof(*delta_base)); > hashcpy(delta_base->sha1, pack_base + pos); Yeah.... but this is a bit wasteful since (especially on 32-bit archs) you just write to the same memory twice in a row. Nicolas - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html