summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2011-11-01 23:21:06 +0100
committerJunio C Hamano <gitster@pobox.com>2011-11-01 15:29:18 -0700
commit395c73560b3716a1f74124826b80ab7ec47d7cd8 (patch)
treea2f7f79fc072a3dee9cd75c595fb31b5197e3299
parent2548183badb98d62079beea62f9d2e1f47e99902 (diff)
downloadgit-395c73560b3716a1f74124826b80ab7ec47d7cd8.tar.gz
name-hash.c: always initialize dir_next pointer
Test t2021-checkout-overwrite.sh reveals a segfault in 'git add' on a case-insensitive file system when git is compiled with XMALLOC_POISON defined. The reason is that 2548183b (fix phantom untracked files when core.ignorecase is set) added a new member dir_next to struct cache_entry, but forgot to initialize it in all cases. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--name-hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/name-hash.c b/name-hash.c
index 225dd76995..d8d25c23e9 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -74,7 +74,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
if (ce->ce_flags & CE_HASHED)
return;
ce->ce_flags |= CE_HASHED;
- ce->next = NULL;
+ ce->next = ce->dir_next = NULL;
hash = hash_name(ce->name, ce_namelen(ce));
pos = insert_hash(hash, ce, &istate->name_hash);
if (pos) {