From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 17:41:26 +0100 Subject: [PATCH] sync: do not report a partially parsed block list After a parse failure the list kept its full length with zero-filled entries, which callers treated as real blocks. Issue: https://bugs.taler.net/n/12212 Assisted by LLM --- src/lib/sync_api_block_list.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/sync_api_block_list.c b/src/lib/sync_api_block_list.c index 6219024..b0d5b89 100644 --- a/src/lib/sync_api_block_list.c +++ b/src/lib/sync_api_block_list.c @@ -112,8 +112,15 @@ handle_block_list_finished (void *cls, SYNC_block_entry_parse (entry, e)) { + /* do not hand the caller a partially parsed list with + zero-filled entries */ GNUNET_break_op (0); - ld.ec = TALER_EC_GENERIC_PARAMETER_MALFORMED; + ld.ec = TALER_EC_GENERIC_REPLY_MALFORMED; + for (unsigned int i = 0; i < idx; i++) + SYNC_block_entry_clear (&ld.entries[i]); + GNUNET_free (ld.entries); + ld.entries = NULL; + ld.num_entries = 0; break; } } -- 2.47.3