A dataset which is too short to even hold the length of the TPV string
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.
Skip such a dataset like the other bogus datasets instead.
Fixes: 2b901d69d8fb ("alfred: Add support for passing location information over
alfred.")
Signed-off-by: Sven Eckelmann <[email protected]>
---
gpsd/alfred-gpsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gpsd/alfred-gpsd.c b/gpsd/alfred-gpsd.c
index 57ac9cf..8e2f1f8 100644
--- a/gpsd/alfred-gpsd.c
+++ b/gpsd/alfred-gpsd.c
@@ -242,7 +242,7 @@ static int gpsd_read_answer(struct globals *globals)
while ((gpsd_data = gpsd_receive_answer_packet(globals->unix_sock,
&len, source, &ret)) !=
NULL) {
if (len < sizeof(*gpsd_data))
- break;
+ continue;
/* check size and skip bogus packets */
if (len != GPSD_DATA_SIZE(gpsd_data))
--
2.47.3