Skip to content

Commit

Permalink
fix(mdns): Fix potential NULL deref when sending sub-buy
Browse files Browse the repository at this point in the history
Closes coverity reported issue: 473829 Dereference null return value
  • Loading branch information
david-cermak committed Jan 24, 2025
1 parent 7dc87d2 commit 0255c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/mdns/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,9 @@ static void _mdns_send_bye_subtype(mdns_srv_item_t *service, const char *instanc
for (j = 0; j < MDNS_IP_PROTOCOL_MAX; j++) {
if (mdns_is_netif_ready(i, j)) {
mdns_tx_packet_t *packet = _mdns_alloc_packet_default((mdns_if_t)i, (mdns_ip_protocol_t)j);
if (packet == NULL) {
return;
}
packet->flags = MDNS_FLAGS_QR_AUTHORITATIVE;
if (!_mdns_alloc_answer(&packet->answers, MDNS_TYPE_PTR, service->service, NULL, true, true)) {
_mdns_free_tx_packet(packet);
Expand Down

0 comments on commit 0255c1d

Please sign in to comment.