diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-07-03 00:25:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-03 00:34:59 -0700 |
commit | 6991357513bf8bfbb71a4675e271b386cc273476 (patch) | |
tree | 3369267f2ff1b0da1c9a63768fdd1aa7da49167b /decorate.c | |
parent | 6cbf8b00fb27f5f55f1a5645ba60c451cb090fc1 (diff) | |
download | git-6991357513bf8bfbb71a4675e271b386cc273476.tar.gz |
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 <gitster@pobox.com>
Diffstat (limited to 'decorate.c')
-rw-r--r-- | decorate.c | 5 |
1 files changed, 1 insertions, 4 deletions
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)); |