SoW-2020-0003: Trace Hit Counters
[lttng-tools.git] / src / common / actions / group.c
index f5720741598af8c1288c1a383e38f3bd7c9be6e0..f7bbfd5a9155aac87fd93fb6b211466b7ea0435b 100644 (file)
@@ -16,7 +16,7 @@
 #include <lttng/action/group.h>
 
 #define IS_GROUP_ACTION(action) \
-       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_GROUP)
+       (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_GROUP)
 
 struct lttng_action_group {
        struct lttng_action parent;
@@ -217,6 +217,11 @@ ssize_t lttng_action_group_create_from_payload(
                                lttng_payload_view_from_view(view, consumed_len,
                                                view->buffer.size - consumed_len);
 
+               if (!lttng_payload_view_is_valid(&child_view)) {
+                       consumed_len = -1;
+                       goto end;
+               }
+
                consumed_len_child = lttng_action_create_from_payload(
                                &child_view, &child_action);
                if (consumed_len_child < 0) {
@@ -348,3 +353,11 @@ const struct lttng_action *lttng_action_group_get_at_index(
 end:
        return action;
 }
+
+struct lttng_action *lttng_action_group_get_mutable_at_index(
+               struct lttng_action *group,
+               unsigned int index)
+{
+       return (struct lttng_action *) lttng_action_group_get_at_index(
+                       (const struct lttng_action *) group, index);
+}
This page took 0.02437 seconds and 5 git commands to generate.