From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 17:41:26 +0100 Subject: [PATCH] exchangedb: require one do_import_credits row per reserve transfer Fewer rows than transfers left entries of the duplicate flags unset, and the caller read them all. Issue: https://bugs.taler.net/n/12216 Assisted by LLM --- src/exchangedb/do_import_credits.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/exchangedb/do_import_credits.c b/src/exchangedb/do_import_credits.c index 0900a5bad..50447dda9 100644 --- a/src/exchangedb/do_import_credits.c +++ b/src/exchangedb/do_import_credits.c @@ -99,11 +99,12 @@ helper_cb (void *cls, { struct Context *ctx = cls; - if (num_results > ctx->length) + if (num_results != ctx->length) { /* The procedure returns one row per reserve transfer we passed in; a - different count means the two have drifted apart, and writing past the - caller's array is not the way to find that out. */ + different count means the two have drifted apart. More rows would + write past the caller's array, fewer would leave entries of it + unset. */ GNUNET_break (0); ctx->status = GNUNET_SYSERR; return; -- 2.47.3