summaryrefslogtreecommitdiffstats
path: root/source/smbd/mangle_hash.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-18 12:21:10 -0800
committerKarolin Seeger <kseeger@samba.org>2010-02-24 16:25:10 +0100
commita7dc17eedc69a838fb00d0535bf2e459d2841f8a (patch)
tree63973f9be930591f92bed58df1c71eed3a207ec4 /source/smbd/mangle_hash.c
parentc02aa2fb818762d6197255396c64e54be88d22a9 (diff)
downloadsamba-a7dc17eedc69a838fb00d0535bf2e459d2841f8a.tar.gz
samba-a7dc17eedc69a838fb00d0535bf2e459d2841f8a.tar.xz
samba-a7dc17eedc69a838fb00d0535bf2e459d2841f8a.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. (cherry picked from commit a4e8210ba7d6d471cb9f17754244393b9c1e5930) (cherry picked from commit 80d9663b3635ed7b2e9b3308d27aed08cd1f38fb)
Diffstat (limited to 'source/smbd/mangle_hash.c')
-rw-r--r--source/smbd/mangle_hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/smbd/mangle_hash.c b/source/smbd/mangle_hash.c
index 7073c3c64eb..e081a57484a 100644
--- a/source/smbd/mangle_hash.c
+++ b/source/smbd/mangle_hash.c
@@ -335,6 +335,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;