Browse files

name-hash.c: always initialize dir_next pointer

Test reveals a segfault in 'git add' on a
case-insensitive file system when git is compiled with XMALLOC_POISON
defined. The reason is that 2548183 (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 <>
Signed-off-by: Junio C Hamano <>
  • Loading branch information...
1 parent 2548183 commit 395c73560b3716a1f74124826b80ab7ec47d7cd8 @j6t j6t committed with gitster Nov 1, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 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)
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) {

0 comments on commit 395c735

Please sign in to comment.