summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-18 12:21:10 -0800
committerKarolin Seeger <kseeger@samba.org>2010-02-19 14:32:29 +0100
commit3f2d27f7b3a4528be5dc58b4bb05201c6ffc4825 (patch)
treea89491313308af9546ac737657601a47d9ea5e6d
parent1bf50973818166c798f0dc86e9627a9be7353aa4 (diff)
downloadsamba-3f2d27f7b3a4528be5dc58b4bb05201c6ffc4825.tar.gz
Fix bug #7155 - valgrind Conditional jump or move depends on uninitialised value(s) error when "mangling method = hash"
The charset array allocated in init_chartest() is allocated by MALLOC, but only some elements of it being set after allocation. Fix is to memset to zero after allocation. Jeremy. (cherry picked from commit a4e8210ba7d6d471cb9f17754244393b9c1e5930) (cherry picked from commit fd906e77a0959189db767392981a89b5130939e2)
-rw-r--r--source3/smbd/mangle_hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 8369af418ae..b54dd5c2978 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -331,6 +331,7 @@ static void init_chartest( void )
chartest = SMB_MALLOC_ARRAY(unsigned char, 256);
SMB_ASSERT(chartest != NULL);
+ memset(chartest, '\0', 256);
for( s = (const unsigned char *)basechars; *s; s++ ) {
chartest[*s] |= BASECHAR_MASK;