vfs_streams_xattr: Fix segfault when running with log level 10
authorChristof Schmitt <cs@samba.org>
Wed, 13 Sep 2017 23:23:53 +0000 (16:23 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 14 Sep 2017 08:58:12 +0000 (10:58 +0200)
commit1b6aa39fac0825b1f25fd62a6c67994b5c491170
treef13c7b4cb79d6551172b3ee2c09bc6e6c8a41d26
parent8d9a050a844822a0415cf4488c9ee687d613dd87
vfs_streams_xattr: Fix segfault when running with log level 10

This happens when vfs_streams_xattr is loaded, log level is set to 10
and the default stream of a file or directory is accessed. In that case
streams_xattr_open does not allocate the stream_io fsp extension. The
DBG_DEBUG message in streams_xattr_fstat tries to access the stream_io
before checking for a NULL value, resulting in the crash. Fix this by
moving the debug message after the check for a NULL pointer.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13032

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Sep 14 10:58:12 CEST 2017 on sn-devel-144
source3/modules/vfs_streams_xattr.c