r4357: Return a more sensible error code if a NULL (as opposed to the valid
authorAndrew Bartlett <abartlet@samba.org>
Fri, 24 Dec 2004 10:56:23 +0000 (10:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:07:37 +0000 (13:07 -0500)
"") username is asked for.

Andrew Bartlett
(This used to be commit 9c9055603e1171e204f67b019900339f88414841)

source4/libcli/auth/ntlmssp.c

index bee93985acd7698c14a701bfa1679acddddf99a4..6ece0f6df611c3479dba2fd8b410b665294a0450 100644 (file)
@@ -145,10 +145,11 @@ static NTSTATUS set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *ch
 
 NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) 
 {
-       ntlmssp_state->user = talloc_strdup(ntlmssp_state, user);
        if (!user) {
-               ntlmssp_state->user = NULL;
+               /* it should be at least "" */
+               return NT_STATUS_INVALID_PARAMETER;
        }
+       ntlmssp_state->user = talloc_strdup(ntlmssp_state, user);
        if (!ntlmssp_state->user) {
                return NT_STATUS_NO_MEMORY;
        }