diff options
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 9b6cf8cd35..acf48d31f9 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1325,8 +1325,12 @@ static int setup_given_passwords(struct setup_password_fields_io *io, g->cleartext_utf16->length, (void *)&cleartext_utf8_str, &converted_pw_len, false)) { - /* We can't bail out entirely, as these unconvertable passwords are frustratingly valid */ + /* We must bail out here, the input wasn't even a multiple of 2 bytes */ talloc_free(cleartext_utf8_blob); + ldb_asprintf_errstring(ldb, + "setup_password_fields: " + "UTF16 password for user %s had odd length (length must be a multiple of 2)", io->u.sAMAccountName); + return LDB_ERR_OPERATIONS_ERROR; } else { *cleartext_utf8_blob = data_blob_const(cleartext_utf8_str, converted_pw_len); |