Ensure we always initialise the winbind context
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Tue, 17 Mar 2015 00:56:12 +0000 (00:56 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 18 Mar 2015 00:41:32 +0000 (01:41 +0100)
Stops segfault when a context is passed. Internal Samba code will
currently always call this with NULL so won't trigger the bug.

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 18 01:41:32 CET 2015 on sn-devel-104

nsswitch/wb_common.c

index 02aab9cac3d8815b39967f71c455cda825907924..036557a2d6d8e54088d79751ca957a28cc81d61b 100644 (file)
@@ -746,7 +746,7 @@ NSS_STATUS winbindd_priv_request_response(struct winbindd_context *ctx,
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
        int count = 0;
-       struct winbindd_context *wb_ctx;
+       struct winbindd_context *wb_ctx = ctx;
 
        if (ctx == NULL) {
                wb_ctx = &wb_global_ctx;