if (!req->data_cb)
return;
- attr = ubus_parse_msg(data);
+ attr = ubus_parse_msg(data, blob_raw_len(data));
if (!attr[UBUS_ATTR_DATA])
return;
static void __ubus_process_req_data(struct ubus_request *req)
{
- struct ubus_pending_data *data;
+ struct ubus_pending_data *data, *tmp;
- while (!list_empty(&req->pending)) {
- data = list_first_entry(&req->pending,
- struct ubus_pending_data, list);
+ list_for_each_entry_safe(data, tmp, &req->pending, list) {
list_del(&data->list);
if (!req->cancelled)
req_data_cb(req, data->type, data->data);
static bool ubus_get_status(struct ubus_msghdr_buf *buf, int *ret)
{
- struct blob_attr **attrbuf = ubus_parse_msg(buf->data);
+ struct blob_attr **attrbuf = ubus_parse_msg(buf->data, blob_raw_len(buf->data));
if (!attrbuf[UBUS_ATTR_STATUS])
return false;
struct ubus_notify_request *nreq;
struct blob_attr **tb;
struct blob_attr *cur;
- int rem, idx = 1;
+ size_t rem;
+ int idx = 1;
int ret = 0;
nreq = container_of(req, struct ubus_notify_request, req);
if (!id) {
/* first id: ubusd's status message with a list of ids */
- tb = ubus_parse_msg(buf->data);
+ tb = ubus_parse_msg(buf->data, blob_raw_len(buf->data));
if (tb[UBUS_ATTR_SUBSCRIBERS]) {
blob_for_each_attr(cur, tb[UBUS_ATTR_SUBSCRIBERS], rem) {
if (!blob_check_type(blob_data(cur), blob_len(cur), BLOB_ATTR_INT32))