From 620b18e9d864196082577bc83b39c7ab13a8bace Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 5 May 2026 18:17:42 +0200 Subject: [PATCH] zeroconf: check for NULL before doing strdup Reject zeroconf entries without name, type, domain or host_name. --- src/modules/zeroconf-utils/zeroconf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/zeroconf-utils/zeroconf.c b/src/modules/zeroconf-utils/zeroconf.c index f11728307..f9ac118bc 100644 --- a/src/modules/zeroconf-utils/zeroconf.c +++ b/src/modules/zeroconf-utils/zeroconf.c @@ -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);