From 40d685ad3e1b52257d5a43befc7a052d72814de6 Mon Sep 17 00:00:00 2001 From: Felix Walter Date: Thu, 22 Dec 2022 15:21:04 +0100 Subject: [PATCH] CLA: RX: Prevent infinite loop in buffer_read Sometimes the parser does not read any data and goes into the error state. In this case we get an infinite loop as `buffer_read` resets the parsers but does not hand back control to the caller. Signed-off-by: Felix Walter --- components/cla/cla_contact_rx_task.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/cla/cla_contact_rx_task.c b/components/cla/cla_contact_rx_task.c index 2d98331..4433d1d 100644 --- a/components/cla/cla_contact_rx_task.c +++ b/components/cla/cla_contact_rx_task.c @@ -163,6 +163,7 @@ static uint8_t *buffer_read(struct cla_link *link, uint8_t *stream) link->config->vtable->cla_rx_task_reset_parsers( link ); + break; } else if (HAS_FLAG(rx_data->cur_parser->flags, PARSER_FLAG_BULK_READ)) { /* Bulk read requested - not handled by us. */