From: Volker Lendecke Date: Tue, 19 Aug 2014 14:32:15 +0000 (+0000) Subject: smbd: Properly initialize mangle_hash X-Git-Tag: samba-4.0.22~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a1a13ab5712fa021fdbce75a12c2bc47af24568;p=thirdparty%2Fsamba.git smbd: Properly initialize mangle_hash [Bug 10782] mangle_hash() can fail to initialize charset (smbd crash). https://bugzilla.samba.org/show_bug.cgi?id=10782 Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Aug 26 01:30:38 CEST 2014 on sn-devel-104 --- diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c index 8a44ea2d6a2..f3d85223330 100644 --- a/source3/smbd/mangle_hash.c +++ b/source3/smbd/mangle_hash.c @@ -767,6 +767,10 @@ const struct mangle_fns *mangle_hash_init(void) { mangle_reset(); + if (chartest == NULL) { + init_chartest(); + } + /* Create the in-memory tdb using our custom hash function. */ tdb_mangled_cache = tdb_open_ex("mangled_cache", 1031, TDB_INTERNAL, (O_RDWR|O_CREAT), 0644, NULL, fast_string_hash);