Fix: add stricter checks on packet boundaries
[babeltrace.git] / formats / ctf / types / struct.c
index 21ce96f6d9eae370ebf0cd5ffe5d10000caab387..cbf53c1edb58a9d29a03ff449a7c7d16b8401d14 100644 (file)
 
 #include <babeltrace/ctf/types.h>
 
-int ctf_struct_rw(struct stream_pos *ppos, struct definition *definition)
+int ctf_struct_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 struct_rw(ppos, definition);
+       if (!ctf_align_pos(pos, declaration->alignment))
+               return -EFAULT;
+       return bt_struct_rw(ppos, definition);
 }
This page took 0.023486 seconds and 4 git commands to generate.