]> git.ipfire.org Git - thirdparty/samba.git/commit
lib: smb_threads: fix access before init bug
authorRalph Boehme <slow@samba.org>
Tue, 3 Jul 2018 13:30:33 +0000 (15:30 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 12 Jul 2018 11:11:22 +0000 (13:11 +0200)
commit6699ce8ec32205969aafe964779959295eb87098
treec637e3a9cd48492903b7adc54454c7871a51c744
parentc93357b78a61895089d0aac31e18d83fc427bab8
lib: smb_threads: fix access before init bug

talloc_stackframe_internal() calls SMB_THREAD_GET_TLS(global_ts)  which
calls smb_get_tls_pthread() in the POSIX pthread wrapper implementation.

If SMB_THREAD_SET_TLS() hasn't been called before, global_ts is NULL and
smb_get_tls_pthread dereferences it so it crashes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13505

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit e311801e0e7171a2b50e39d3e0c2d2137f8b3d7e)
lib/util/smb_threads.h