The check for the return value of find_realm_data at https://github.com/krb5/krb5/blob/master/src/kdc/main.c#L691 is reversed, with the result that no valid realm with ever pass validation. Worse, it will be silently ignored, only to fail later when looking for the master key.