auth3: Check for talloc failure
authorVolker Lendecke <vl@samba.org>
Thu, 2 Jan 2020 11:41:16 +0000 (12:41 +0100)
committerGary Lockyer <gary@samba.org>
Mon, 6 Jan 2020 01:47:30 +0000 (01:47 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/auth/auth.c

index 3b523c0fa180b1ca0a36bc6432f6e12058560bdf..ccda7118c7d269f8e481a70eb179693fe2a816b7 100644 (file)
@@ -97,6 +97,10 @@ NTSTATUS auth_get_ntlm_challenge(struct auth_context *auth_context,
        generate_random_buffer(tmp, sizeof(tmp));
        auth_context->challenge = data_blob_talloc(auth_context,
                                                   tmp, sizeof(tmp));
+       if (auth_context->challenge.data == NULL) {
+               DBG_WARNING("data_blob_talloc failed\n");
+               return NT_STATUS_NO_MEMORY;
+       }
 
        auth_context->challenge_set_by = "random";