Skip to content

Commit f5be2f4

Browse files
committed
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.
1 parent 9b74256 commit f5be2f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/mdns/mdns.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5346,7 +5346,8 @@ static void _mdns_service_task(void *pvParameters)
53465346
for (;;) {
53475347
if (_mdns_server && _mdns_server->action_queue) {
53485348
if (xQueueReceive(_mdns_server->action_queue, &a, portMAX_DELAY) == pdTRUE) {
5349-
if (a && a->type == ACTION_TASK_STOP) {
5349+
assert(a);
5350+
if (a->type == ACTION_TASK_STOP) {
53505351
break;
53515352
}
53525353
MDNS_SERVICE_LOCK();

0 commit comments

Comments
 (0)