From e3e271ff70190ad77c6ea43de35e6c4ae190688b Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 27 May 2023 10:36:35 +0000 Subject: [PATCH] hdb/hdb-mitdb: Nix unused variable key_data in mdb_seq. key_data is unused. Presumably this was copypasta from DB_seq in hdb/db.c, where it is used for the Heimdal database format in which the value may be missing a principal but it can be recovered from the key. In contrast, the mit-krb5 format appears to always store the principal in the value and _hdb_mdb_value2entry always retrieves it, with no need for a key2principal fallback. fix https://github.com/heimdal/heimdal/issues/1102 --- lib/hdb/hdb-mitdb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/hdb/hdb-mitdb.c b/lib/hdb/hdb-mitdb.c index 7436f39ed..ae315cd83 100644 --- a/lib/hdb/hdb-mitdb.c +++ b/lib/hdb/hdb-mitdb.c @@ -769,7 +769,7 @@ mdb_seq(krb5_context context, HDB *db, { DB *d = (DB*)db->hdb_db; DBT key, value; - krb5_data key_data, data; + krb5_data data; int code; code = db->hdb_lock(context, db, HDB_RLOCK); @@ -790,8 +790,6 @@ mdb_seq(krb5_context context, HDB *db, return HDB_ERR_NOENTRY; } - key_data.data = key.data; - key_data.length = key.size; data.data = value.data; data.length = value.size; memset(entry, 0, sizeof(*entry));