From 06275d6197f05ad01f2ec5571698fba79cdd68bb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 24 Dec 2004 10:56:23 +0000 Subject: 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) --- source4/libcli/auth/ntlmssp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source4/libcli/auth/ntlmssp.c b/source4/libcli/auth/ntlmssp.c index bee93985ac..6ece0f6df6 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; } -- cgit