From d565eb20f73ff304e904252432da958f5262c801 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 17 Jul 2025 10:43:35 -0700 Subject: [PATCH] nostrdb: query: enforce author matches in author_kind queries before we weren't checking this, meaning we were getting results from other keys. oops. Reported-by: Jeff Gardner Fixes: #84 Signed-off-by: William Casarin --- nostrdb/src/nostrdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index ce6933cc..0546afa5 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -4112,6 +4112,9 @@ static int ndb_query_plan_execute_author_kinds( if (pkey->timestamp < since) break; + if (memcmp(pkey->id, author, 32)) + break; + note_id = *(uint64_t*)v.mv_data; if (!(note = ndb_get_note_by_key(txn, note_id, ¬e_size))) goto next;