From: Felix Fietkau Date: Mon, 8 Jan 2024 09:21:48 +0000 (+0100) Subject: ubus: assume that the service iface can be NULL X-Git-Url: http://git.openwrt.org/?p=project%2Fmdnsd.git;a=commitdiff_plain ubus: assume that the service iface can be NULL Fix crash on dump Signed-off-by: Felix Fietkau --- diff --git a/ubus.c b/ubus.c index 30e6121..6991278 100644 --- a/ubus.c +++ b/ubus.c @@ -104,7 +104,8 @@ umdns_browse(struct ubus_context *ctx, struct ubus_object *obj, *local = '\0'; c2 = blobmsg_open_table(&b, buffer); strncat(buffer, ".local", MAX_NAME_LEN); - blobmsg_add_string(&b, "iface", s->iface->name); + if (s->iface) + blobmsg_add_string(&b, "iface", s->iface->name); cache_dump_records(&b, s->entry, array, &hostname); if (address) cache_dump_records(&b, hostname, array, NULL);