mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
r7472: fix smbpasswd user password change (still worked by bad error messages) due to trying to strdup a NULL pointer
This commit is contained in:
parent
21e7baa5bc
commit
a48ff479dd
@ -138,7 +138,7 @@ static NTSTATUS set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *ch
|
||||
|
||||
NTSTATUS ntlmssp_set_username(NTLMSSP_STATE *ntlmssp_state, const char *user)
|
||||
{
|
||||
ntlmssp_state->user = talloc_strdup(ntlmssp_state->mem_ctx, user);
|
||||
ntlmssp_state->user = talloc_strdup(ntlmssp_state->mem_ctx, user ? user : "" );
|
||||
if (!ntlmssp_state->user) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
@ -168,7 +168,7 @@ NTSTATUS ntlmssp_set_password(NTLMSSP_STATE *ntlmssp_state, const char *password
|
||||
*/
|
||||
NTSTATUS ntlmssp_set_domain(NTLMSSP_STATE *ntlmssp_state, const char *domain)
|
||||
{
|
||||
ntlmssp_state->domain = talloc_strdup(ntlmssp_state->mem_ctx, domain);
|
||||
ntlmssp_state->domain = talloc_strdup(ntlmssp_state->mem_ctx, domain ? domain : "" );
|
||||
if (!ntlmssp_state->domain) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user