s3-netlogon: Make sure we do not deference a NULL pointer.
authorAndreas Schneider <asn@samba.org>
Mon, 16 Feb 2015 09:59:23 +0000 (10:59 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 23 Feb 2015 16:33:07 +0000 (17:33 +0100)
This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/rpc_server/netlogon/srv_netlog_nt.c

index f5f819118fbc7814159feaadf898b8a37def10d2..b487c31e872c0f6c389618b7739a22134584e1e0 100644 (file)
@@ -1274,9 +1274,14 @@ NTSTATUS _netr_ServerPasswordSet(struct pipes_struct *p,
        unbecome_root();
 
        if (!NT_STATUS_IS_OK(status)) {
+               const char *computer_name = "<unknown>";
+
+               if (creds != NULL && creds->computer_name != NULL) {
+                       computer_name = creds->computer_name;
+               }
                DEBUG(2,("_netr_ServerPasswordSet: netlogon_creds_server_step failed. Rejecting auth "
                        "request from client %s machine account %s\n",
-                       r->in.computer_name, creds->computer_name));
+                       r->in.computer_name, computer_name));
                TALLOC_FREE(creds);
                return status;
        }