Re: heads-up: git-index-pack in "next" is broken

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Tuesday, October 17, 2006 - 1:10 pm

Sergey Vlasov <vsu@altlinux.ru> writes:


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);
 		pos += 20;
 		break;
@@ -290,6 +291,7 @@ static void resolve_delta(struct delta_e
 		bad_object(obj->offset, "failed to apply delta");
 	sha1_object(result, result_size, type, obj->sha1);
 
+	memset(&delta_base, 0, sizeof(delta_base));
 	hashcpy(delta_base.sha1, obj->sha1);
 	if (!find_delta_childs(&delta_base, &first, &last)) {
 		for (j = first; j <= last; j++)
@@ -365,6 +367,7 @@ static void parse_pack_objects(void)
 
 		if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA)
 			continue;
+		memset(&base, 0, sizeof(base));
 		hashcpy(base.sha1, obj->sha1);
 		ref = !find_delta_childs(&base, &ref_first, &ref_last);
 		memset(&base, 0, sizeof(base));

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Mon Oct 16, 9:55 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 9:07 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Nicolas Pitre, (Tue Oct 17, 10:00 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 11:11 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Nicolas Pitre, (Tue Oct 17, 11:47 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Sergey Vlasov, (Tue Oct 17, 12:36 pm)
Re: heads-up: git-index-pack in "next" is broken, Junio C Hamano, (Tue Oct 17, 1:10 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Tue Oct 17, 1:51 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Tue Oct 17, 2:46 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 2:54 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Tue Oct 17, 5:57 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 6:30 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Tue Oct 17, 8:12 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 9:16 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Junio C Hamano, (Tue Oct 17, 10:07 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Davide Libenzi, (Tue Oct 17, 11:09 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Johannes Schindelin, (Wed Oct 18, 3:00 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Wed Oct 18, 7:56 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Davide Libenzi, (Wed Oct 18, 9:17 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Wed Oct 18, 9:52 am)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Davide Libenzi, (Wed Oct 18, 2:21 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Linus Torvalds, (Wed Oct 18, 2:48 pm)
Re: heads-up: git-index-pack in &quot;next&quot; is broken, Davide Libenzi, (Wed Oct 18, 3:34 pm)