From 3725024ea0dade2101bf48b76bcdc81d88808f26 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Mon, 9 Dec 2024 15:58:30 +0530 Subject: [PATCH] Fix empty ubus output --- libbbfdm-ubus/bbfdm-ubus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libbbfdm-ubus/bbfdm-ubus.c b/libbbfdm-ubus/bbfdm-ubus.c index 1ebb84d6..626f1d76 100644 --- a/libbbfdm-ubus/bbfdm-ubus.c +++ b/libbbfdm-ubus/bbfdm-ubus.c @@ -72,10 +72,14 @@ static void fill_optional_data(bbfdm_data_t *data, struct blob_attr *msg) struct blob_attr *attr; size_t rem; - if (!data || !msg) + if (!data) return; data->bbf_ctx.dm_type = BBFDM_BOTH; + + if (!msg) + return; + blobmsg_for_each_attr(attr, msg, rem) { if (is_str_eq(blobmsg_name(attr), "proto")) {