[PATCH 6/8] alfred: vis: don't drop the rest of the answer for a bogus dataset
Sven Eckelmann <[email protected]> Tue, 28 Jul 2026 18:01:35 +0200
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
A dataset which is too short to even hold the length of the vis_data
(header) aborted the processing of the answer. The positions of all
following nodes were dropped from the printed document although only the
dataset of a single node was malformed.
This skipped the ops->postamble() call. For the jsondoc/dot format, the
syntax was wrong because of this, the output was never finished.
Skip such a bogus datasets instead and process the rest of the answers.
Fixes: 38eae4d50e81 ("vis: Add an output format which is json conformant.")
Signed-off-by: Sven Eckelmann <[email protected]>
---
vis/vis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vis/vis.c b/vis/vis.c
index 451d79c..93f444b 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -1033,7 +1033,7 @@ static int vis_read_answer(struct globals *globals)
while ((vis_data =
vis_receive_answer_packet(globals->unix_sock, &len, &ret)) != NULL) {
if (len < sizeof(*vis_data))
- return -1;
+ continue;
/* check size and skip bogus packets */
if (len != VIS_DATA_SIZE(vis_data))
--
2.47.3