[UBUS_ATTR_GROUP] = { .type = BLOB_ATTR_STRING },
};
-struct blob_attr **ubus_parse_msg(struct blob_attr *msg)
+struct blob_attr **ubus_parse_msg(struct blob_attr *msg, size_t len)
{
- blob_parse(msg, attrbuf, ubus_policy, UBUS_ATTR_MAX);
+ blob_parse_untrusted(msg, len, attrbuf, ubus_policy, UBUS_ATTR_MAX);
return attrbuf;
}
/* Note: no callback should free the `ub` buffer
that's always done right after the callback finishes */
if (cb)
- ret = cb(cl, ub, ubus_parse_msg(ub->data));
+ ret = cb(cl, ub, ubus_parse_msg(ub->data, blob_raw_len(ub->data)));
else
ret = UBUS_STATUS_INVALID_COMMAND;
void ubusd_proto_free_client(struct ubus_client *cl)
{
- struct ubus_object *obj;
+ struct ubus_object *obj, *tmp;
- while (!list_empty(&cl->objects)) {
- obj = list_first_entry(&cl->objects, struct ubus_object, list);
+ list_for_each_entry_safe(obj, tmp, &cl->objects, list) {
ubusd_free_object(obj);
}
+
ubus_msg_free(cl->retmsg);
blob_buf_free(&cl->b);