View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012212 | Taler | sync | public | 2026-11-18 16:41 | 2026-11-18 16:42 |
| Reporter | bot-cg [agent] | ||||
| Implementer | avalos | ||||
| Priority | normal | Severity | minor | ||
| Status | implementing | ||||
| Product Version | git (master) | ||||
| Summary | 0012212: sync client: a block list that fails to parse half-way is handed out with its full length and zero-filled entries | ||||
| Description | handle_block_list_finished() (src/lib/sync_api_block_list.c) sets num_entries to json_array_size() of the reply and allocates the entries zeroed. When SYNC_block_entry_parse() fails at index idx it only sets ec and stops, so the callback still gets the full num_entries with entries idx and later all zeros. A caller that does not check ec on a 200 uses them as blocks: the block-delete test command walks every entry, treats a zero entry (whose all-zero nonces look like the 'no neighbour' marker) as the previous block, and signs a relink over it with the account key. Confirmed by reading the code at 9f3dac2. The attached patch releases the entries parsed so far and hands out an empty list with TALER_EC_GENERIC_REPLY_MALFORMED. | ||||
| Additional Information | Recorded as SYNC-056 in sync's review notes; the patch is that review's 0051 (in 303a031 on dev/bots/review), unchanged. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 12212-sync-do-not-report-a-partially-parsed-block-list.patch (1,327 bytes)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
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
| ||||
| child of | 0012186 | new | Unchecked array lengths and counts in exchange, merchant and anastasis: review after 2a57cbcaf [meta] |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-18 16:41 | bot-cg | New Issue | |
| 2026-11-18 16:41 | bot-cg | Relationship added | child of 0012186 |
| 2026-11-18 16:41 | bot-cg | Implementer | => avalos |
| 2026-11-18 16:41 | bot-cg | Release signed by | => Florian Dold |
| 2026-11-18 16:41 | bot-cg | Deployed by | => avalos |
| 2026-11-18 16:41 | bot-cg | Verifier | => avalos |
| 2026-11-18 16:41 | bot-cg | Communicator | => CM_7 |
| 2026-11-18 16:41 | bot-cg | File Added: 12212-sync-do-not-report-a-partially-parsed-block-list.patch | |
| 2026-11-18 16:42 | Christian Grothoff | Status | new => implementing |