summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-11-11 18:36:06 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-11 09:55:06 +0000
commit78928f5956d1b593e92875fd46a7071a4c979640 (patch)
tree962751b4aa798a73395d17a8c102eb4586a2ded3
parenteebbbeac1489a1a6241b4c15064d8aaeeec810ae (diff)
downloadsamba-78928f5956d1b593e92875fd46a7071a4c979640.tar.gz
samba-78928f5956d1b593e92875fd46a7071a4c979640.tar.bz2
samba-78928f5956d1b593e92875fd46a7071a4c979640.zip
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
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c9
1 files changed, 3 insertions, 6 deletions
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;