Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2] index-pack: always zero-initialize object_entry list

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:26

Thomas Rast [off-list ref] writes:
It apparently relates to the use of .idx.offset to compute the "next"
offset, cf. append_obj_to_pack():

	struct object_entry *obj = &objects[nr_objects++];
   ...
	obj[1].idx.offset = obj[0].idx.offset + n;
	obj[1].idx.offset += write_compressed(f, buf, size);

So you trashed the offset of the first object after all the objects that
are actually *in* the patch.

And with that: ACK.
Ahh, I also was scratching my head about that +1 thing.  After all,
the +1 in the argument to xrealloc() was already a clue.

Thanks both for digging to the bottom of this one.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help