From c75811fc6879fb9dbc78f56578be3346faa98cac Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 15 Aug 2006 23:45:54 +0000 Subject: [PATCH] * kdb5_ldap_realm.c (kdb5_ldap_create): In assertion test of hardcoded char array sizes, test against the size we actually need. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18449 dc483132-0cff-0310-8789-dd5450dbe970 --- src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c index 1e597b7c5..2c62522af 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_realm.c @@ -853,7 +853,7 @@ void kdb5_ldap_create(argc, argv) com_err(argv[0], retval, "gethostbyname, while adding entries to the database"); goto err_nomsg; } - assert (sizeof(princ_name) >= MAXHOSTNAMELEN + 8); + assert (sizeof(princ_name) >= strlen(hp->h_name) + strlen(global_params.realm) + 9); /* snprintf(princ_name, MAXHOSTNAMELEN + 8, "kadmin/%s", hp->h_name); */ snprintf(princ_name, sizeof(princ_name), "kadmin/%s@%s", hp->h_name, global_params.realm); if ((retval = krb5_parse_name(util_context, princ_name, &p))) { -- 2.26.2