From: John Carr Date: Sun, 23 Feb 1992 12:15:07 +0000 (+0000) Subject: Compare key lengths before comparing key data X-Git-Tag: krb5-1.0-beta2~238 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4aa059f9fa548b8e960efbf279403416a8ba57d9;p=krb5.git Compare key lengths before comparing key data git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2224 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/verify_mky.c b/src/lib/kdb/verify_mky.c index 6f62fd18b..3b1278b7f 100644 --- a/src/lib/kdb/verify_mky.c +++ b/src/lib/kdb/verify_mky.c @@ -76,8 +76,8 @@ krb5_encrypt_block *eblock; krb5_db_free_principal(&master_entry, nprinc); return retval; } - if (memcmp((char *)mkey->contents, (char *)tempkey.contents, - mkey->length)) { + if (mkey->length != tempkey.length || + memcmp((char *)mkey->contents, (char *)tempkey.contents,mkey->length)) { retval = KRB5_KDB_BADMASTERKEY; (void) krb5_finish_key(eblock); } else