zeroconf: check for NULL before doing strdup

Reject zeroconf entries without name, type, domain or host_name.
This commit is contained in:
Wim Taymans 2026-05-05 18:17:42 +02:00
parent f57a2e9680
commit 620b18e9d8

View file

@ -178,6 +178,10 @@ static struct service *service_new(struct entry *e,
s->e = e;
spa_list_append(&e->services, &s->link);
if (info->name == NULL || info->type == NULL ||
info->domain == NULL || info->host_name == NULL)
goto error;
s->info.interface = info->interface;
s->info.protocol = info->protocol;
s->info.name = strdup(info->name);