From 78928f5956d1b593e92875fd46a7071a4c979640 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 11 Nov 2010 18:36:06 +1100 Subject: s4-dsdb Remove incorrectly declared ** variable used as *. The cleartext_utf16_str variable was declared char **, but due to the cast on convert_string_talloc() and the lack of type checking here and on data_blob_const (due to void *) it was able to be used as if it was a char *. The simple solution seems to be to fill in cleartext_utf16 blob directly. Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/password_hash.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index acf48d31f9..1d09f4d517 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1288,9 +1288,7 @@ static int setup_given_passwords(struct setup_password_fields_io *io, ldb = ldb_module_get_ctx(io->ac->module); if (g->cleartext_utf8) { - char **cleartext_utf16_str; struct ldb_val *cleartext_utf16_blob; - size_t converted_pw_len; cleartext_utf16_blob = talloc(io->ac, struct ldb_val); if (!cleartext_utf16_blob) { @@ -1300,15 +1298,14 @@ static int setup_given_passwords(struct setup_password_fields_io *io, CH_UTF8, CH_UTF16, g->cleartext_utf8->data, g->cleartext_utf8->length, - (void *)&cleartext_utf16_str, - &converted_pw_len, false)) { + (void *)&cleartext_utf16_blob->data, + &cleartext_utf16_blob->length, + false)) { ldb_asprintf_errstring(ldb, "setup_password_fields: " "failed to generate UTF16 password from cleartext UTF8 password"); return LDB_ERR_OPERATIONS_ERROR; } - *cleartext_utf16_blob = data_blob_const(cleartext_utf16_str, - converted_pw_len); g->cleartext_utf16 = cleartext_utf16_blob; } else if (g->cleartext_utf16) { char *cleartext_utf8_str; -- cgit