diff --git a/lib/kadm5/password_quality.c b/lib/kadm5/password_quality.c index 6115ce3f9..2cd80880b 100644 --- a/lib/kadm5/password_quality.c +++ b/lib/kadm5/password_quality.c @@ -107,7 +107,7 @@ char_class_passwd_quality (krb5_context context, len = pwd->length + 1; pw = malloc(len); if (pw == NULL) { - strlcpy(message, "out of memory", sizeof(message)); + strlcpy(message, "out of memory", length); return 1; } strlcpy(pw, pwd->data, len); @@ -166,7 +166,7 @@ external_passwd_quality (krb5_context context, ret = krb5_unparse_name(context, principal, &p); if (ret) { - strlcpy(message, "out of memory", sizeof(message)); + strlcpy(message, "out of memory", length); return 1; }