summaryrefslogtreecommitdiff
path: root/source4/kdc/hdb-ldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/kdc/hdb-ldb.c')
-rw-r--r--source4/kdc/hdb-ldb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index af93ea8f72..444382f2a0 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -360,12 +360,14 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
}
if (ret == 0) {
+ size_t num_keys = ent->keys.len;
/*
* create keys from unicodePwd
*/
ret = hdb_generate_key_set_password(context, salt_principal,
- unicodePwd,
- &ent->keys.val, &ent->keys.len);
+ unicodePwd,
+ &ent->keys.val, &num_keys);
+ ent->keys.len = num_keys;
krb5_free_principal(context, salt_principal);
}
@@ -387,7 +389,8 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
} else if (val->length < 16) {
ent->keys.val = NULL;
ent->keys.len = 0;
- krb5_warnx(context, "ntPwdHash has invalid length: %d\n",val->length);
+ krb5_warnx(context, "ntPwdHash has invalid length: %d\n",
+ (int)val->length);
} else {
ret = krb5_data_alloc (&keyvalue, 16);
if (ret) {