summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-10 22:03:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:10 -0500
commit46c94b2659fa1f9d7ce2b6fd798e3abb3c7760d8 (patch)
treea4b9e5ffc9ca10de5b17d05b4a7349ac1e610cf4 /source3/libsmb
parent5b0e40fabf133d2bb413e2e72356b33df2221a2d (diff)
downloadsamba-46c94b2659fa1f9d7ce2b6fd798e3abb3c7760d8.tar.gz
samba-46c94b2659fa1f9d7ce2b6fd798e3abb3c7760d8.tar.bz2
samba-46c94b2659fa1f9d7ce2b6fd798e3abb3c7760d8.zip
r7472: fix smbpasswd user password change (still worked by bad error messages) due to trying to strdup a NULL pointer
(This used to be commit a48ff479dd4fe99d199ff934aae14ac6e688d8f4)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/ntlmssp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c
index 4d9aaf989b..574b37d4a0 100644
--- a/source3/libsmb/ntlmssp.c
+++ b/source3/libsmb/ntlmssp.c
@@ -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;
}