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 13:40:09 +0000 (14:40 +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 34b9a024d65b2a09ee4a6b1c60ac90ee0676816b..701d2997e2138e5a1c8f71be05148867f8362bc7 100644 (file)
@@ -1275,9 +1275,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;
        }