fix(mdns): Fix potential null derefernce in _mdns_execute_action()

We did check for null-deref before checking 'a->type', but contol
continues and passes potential null-ptr to the processing function
_mdns_execute_action()
Fixed by asserting action != NULL, since it is an invalid state which
should never happen.
This commit is contained in:
David Cermak
2025-01-13 11:37:51 +01:00
parent 9b74256b51
commit f5be2f4115

View File

@ -5346,7 +5346,8 @@ static void _mdns_service_task(void *pvParameters)
for (;;) {
if (_mdns_server && _mdns_server->action_queue) {
if (xQueueReceive(_mdns_server->action_queue, &a, portMAX_DELAY) == pdTRUE) {
if (a && a->type == ACTION_TASK_STOP) {
assert(a);
if (a->type == ACTION_TASK_STOP) {
break;
}
MDNS_SERVICE_LOCK();