wbclient: ensure response struct is initialized
authorAlexander Bokovoy <ab@samba.org>
Wed, 7 May 2014 08:00:46 +0000 (11:00 +0300)
committerJeremy Allison <jra@samba.org>
Thu, 8 May 2014 02:24:53 +0000 (04:24 +0200)
commit06c25eb25e389652a9cd87f08729f30e4df6b25b
tree9366cefc31bdc049f0ab7a7ef805102b76b62203
parenta5b96ee5fb97528767fc63aa8e70a314686ee38a
wbclient: ensure response struct is initialized

Prior to asking for a winbindd private pipe we need to initialize
response structure to deal with a possible response failure.

winbind_open_pipe_sock() issues two winbindd requests:
 - asks for interface version
 - asks for a private pipe

The first call returns interface version in a response structure (which
is a union). The second call might fail -- in this case response
structure will not be initialized or filled in with any information.

As result, if the second call failed, response structure will have data
from an interface string interpreted as a pointer to a string during
SAFE_FREE() at the end of the winbind_open_pipe_sock().

To avoid that, ensure response struct is initialized before asking for
a private pipe.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  8 04:24:53 CEST 2014 on sn-devel-104
nsswitch/wb_common.c