s3-auth: Fix a possible null pointer dereference
authorAndreas Schneider <asn@samba.org>
Fri, 17 Jul 2015 08:54:17 +0000 (10:54 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 21 Jul 2015 17:02:14 +0000 (19:02 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11404

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 109ff388fd5e1306189d680a8f964a69374f1b01)

Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Tue Jul 21 19:02:14 CEST 2015 on sn-devel-104

source3/auth/auth_ntlmssp.c

index f99bd44d7edd021a3f3b10e7c522415e30cdc227..dae5f776a0b2dfe89f30611ecc28ec7f31da0fd5 100644 (file)
@@ -153,7 +153,9 @@ NTSTATUS auth3_check_password(struct auth4_context *auth4_context,
                                                        &server_info,
                                                        user_info->client.account_name,
                                                        user_info->client.domain_name);
-               *server_returned_info = talloc_steal(mem_ctx, server_info);
+               if (NT_STATUS_IS_OK(nt_status)) {
+                       *server_returned_info = talloc_steal(mem_ctx, server_info);
+               }
                return nt_status;
        }