Fix: add stricter checks on packet boundaries
[babeltrace.git] / formats / ctf / types / variant.c
index 297f26ff5feb3f9e739e82fb8c7582f3dec6dfca..fc7b7ad449d935ea4dcf9e32afda839463250141 100644 (file)
 
 #include <babeltrace/ctf/types.h>
 
-int ctf_variant_rw(struct stream_pos *ppos, struct definition *definition)
+int ctf_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition)
 {
-       struct declaration *declaration = definition->declaration;
+       struct bt_declaration *declaration = definition->declaration;
        struct ctf_stream_pos *pos = ctf_pos(ppos);
 
-       ctf_align_pos(pos, declaration->alignment);
-       return variant_rw(ppos, definition);
+       if (!ctf_align_pos(pos, declaration->alignment))
+               return -EFAULT;
+       return bt_variant_rw(ppos, definition);
 }
This page took 0.024108 seconds and 4 git commands to generate.