diff options
author | Jeremy Allison <jra@samba.org> | 2012-08-08 17:01:00 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-08-09 12:08:18 -0700 |
commit | b70f23c2b581c5d455362ab37f4846de9a910055 (patch) | |
tree | cf95e8d35a03d1e39d5926d2e03d7046d42cae64 /source3/libnet | |
parent | ce21d0804012da27cec72abe896352d7f0e7e1e5 (diff) | |
download | samba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.gz samba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.bz2 samba-b70f23c2b581c5d455362ab37f4846de9a910055.zip |
Correctly check for errors in strlower_m() returns.
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 5806f7bc75..d6aa7937ee 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -395,7 +395,9 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx, r->out.dns_domain_name); } - strlower_m(my_fqdn); + if (!strlower_m(my_fqdn)) { + return ADS_ERROR_LDAP(LDAP_NO_MEMORY); + } if (!strequal(my_fqdn, r->in.machine_name)) { spn = talloc_asprintf(mem_ctx, "HOST/%s", my_fqdn); @@ -817,7 +819,9 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx, /* according to WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED */ fstrcpy(trust_passwd, r->in.admin_password); - strlower_m(trust_passwd); + if (!strlower_m(trust_passwd)) { + return NT_STATUS_INVALID_PARAMETER; + } /* * Machine names can be 15 characters, but the max length on @@ -934,7 +938,10 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx, /* Create domain user */ acct_name = talloc_asprintf(mem_ctx, "%s$", r->in.machine_name); - strlower_m(acct_name); + if (!strlower_m(acct_name)) { + status = NT_STATUS_INVALID_PARAMETER; + goto done; + } init_lsa_String(&lsa_acct_name, acct_name); @@ -1367,7 +1374,10 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx, /* Create domain user */ acct_name = talloc_asprintf(mem_ctx, "%s$", r->in.machine_name); - strlower_m(acct_name); + if (!strlower_m(acct_name)) { + status = NT_STATUS_INVALID_PARAMETER; + goto done; + } init_lsa_String(&lsa_acct_name, acct_name); |