summaryrefslogtreecommitdiff
path: root/source3/passdb/secrets.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb/secrets.c')
-rw-r--r--source3/passdb/secrets.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 34a87bd0d0..a7223b7e9f 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -685,6 +685,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
{
smb_ucs2_t *uni_dom_name;
bool ret;
+ size_t converted_size;
/* packing structures */
uint8 *pass_buf = NULL;
@@ -693,7 +694,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
struct trusted_dom_pass pass;
ZERO_STRUCT(pass);
- if (push_ucs2_allocate(&uni_dom_name, domain) == (size_t)-1) {
+ if (!push_ucs2_allocate(&uni_dom_name, domain, &converted_size)) {
DEBUG(0, ("Could not convert domain name %s to unicode\n",
domain));
return False;
@@ -926,7 +927,7 @@ struct list_trusted_domains_state {
static int list_trusted_domain(struct db_record *rec, void *private_data)
{
const size_t prefix_len = strlen(SECRETS_DOMTRUST_ACCT_PASS);
- size_t packed_size = 0;
+ size_t converted_size, packed_size = 0;
struct trusted_dom_pass pass;
struct trustdom_info *dom_info;
@@ -960,8 +961,8 @@ static int list_trusted_domain(struct db_record *rec, void *private_data)
return 0;
}
- if (pull_ucs2_talloc(dom_info, &dom_info->name,
- pass.uni_name) == (size_t)-1) {
+ if (!pull_ucs2_talloc(dom_info, &dom_info->name, pass.uni_name,
+ &converted_size)) {
DEBUG(2, ("pull_ucs2_talloc failed\n"));
TALLOC_FREE(dom_info);
return 0;