summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-18 12:21:10 -0800
committerJeremy Allison <jra@samba.org>2010-02-18 12:21:10 -0800
commita4e8210ba7d6d471cb9f17754244393b9c1e5930 (patch)
tree270374fcc8dce5cdf3978ac1e171e727aa4b0ff8
parentdf13b1303a751962d8f7d5298b39e4a7500fef15 (diff)
downloadsamba-a4e8210ba7d6d471cb9f17754244393b9c1e5930.tar.gz
samba-a4e8210ba7d6d471cb9f17754244393b9c1e5930.tar.bz2
samba-a4e8210ba7d6d471cb9f17754244393b9c1e5930.zip
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.
-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 1482d10b7a..d1af0994a8 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;