From 6991357513bf8bfbb71a4675e271b386cc273476 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 3 Jul 2008 00:25:23 -0700 Subject: fast-export --export-marks: fix off by one error The export_marks() function iterated over a (potentially sparsely populated) hashtable, but it accessed it starting from offset 1 and one element beyond the end. Noticed by SungHyun Nam. Signed-off-by: Junio C Hamano --- decorate.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'decorate.c') diff --git a/decorate.c b/decorate.c index 23f6b0040f..d9668d2ef9 100644 --- a/decorate.c +++ b/decorate.c @@ -37,10 +37,7 @@ static void grow_decoration(struct decoration *n) { int i; int old_size = n->size; - struct object_decoration *old_hash; - - old_size = n->size; - old_hash = n->hash; + struct object_decoration *old_hash = n->hash; n->size = (old_size + 1000) * 3 / 2; n->hash = xcalloc(n->size, sizeof(struct object_decoration)); -- cgit v1.2.3