From: Andrew Bartlett Date: Fri, 24 Dec 2004 10:56:23 +0000 (+0000) Subject: r4357: Return a more sensible error code if a NULL (as opposed to the valid X-Git-Tag: samba-4.0.0alpha6~801^3~12231 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=06275d6197f05ad01f2ec5571698fba79cdd68bb r4357: Return a more sensible error code if a NULL (as opposed to the valid "") username is asked for. Andrew Bartlett (This used to be commit 9c9055603e1171e204f67b019900339f88414841) --- diff --git a/source4/libcli/auth/ntlmssp.c b/source4/libcli/auth/ntlmssp.c index bee93985acd..6ece0f6df61 100644 --- a/source4/libcli/auth/ntlmssp.c +++ b/source4/libcli/auth/ntlmssp.c @@ -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; }