From b639145ce90230e693c41e71624ea0c0798c424d Mon Sep 17 00:00:00 2001 From: Polynomialdivision Date: Thu, 3 Sep 2020 03:45:25 +0200 Subject: [PATCH] ubus: fix rrm string callback function The rrm_nr_get_own call returns an array. We need the 3rd value. We do not need to call blobmsg_data before blobmsg_get_string to extract the value. Additionally this causes strange behavior where an offset in the string is accessed. --- src/utils/ubus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/ubus.c b/src/utils/ubus.c index 7b064f5..3f2b799 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -741,7 +741,7 @@ static void ubus_get_rrm_cb(struct ubus_request *req, int type, struct blob_attr { if(i==2) { - char* neighborreport = blobmsg_get_string(blobmsg_data(attr)); + char* neighborreport = blobmsg_get_string(attr); strcpy(entry->neighbor_report,neighborreport); printf("Copied Neighborreport: %s,\n", entry->neighbor_report); }