Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH 7/3] Make index preloading check the whole path to the file

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:47:02
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)


On Thu, 9 Jul 2009, Linus Torvalds wrote:
It should be memset() to zero. Good catch.
IOW, just this on top. It's the same initialization  that 'default_cache' 
has, except in the case of default_cahe it was implicit in the "static", 
which is why I missed it when I did the "obvious" version.

		Linus
---
 preload-index.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/preload-index.c b/preload-index.c
index c3462dc..14d5281 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -36,6 +36,7 @@ static void *preload_thread(void *_data)
 	struct cache_entry **cep = index->cache + p->offset;
 	struct cache_def cache;
 
+	memset(&cache, 0, sizeof(cache));
 	nr = p->nr;
 	if (nr + p->offset > index->cache_nr)
 		nr = index->cache_nr - p->offset;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help