Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: set effective byte order of FT copy _and_ original #103

Open
wants to merge 1 commit into
base: stable-1.5
Choose a base branch
from

Conversation

eepp
Copy link
Member

@eepp eepp commented Mar 12, 2019

No description provided.

In bt_ctf_trace_add_stream_class() and
bt_ctf_stream_class_add_event_class(), it is possible that field types
are copied for length/tag field type resolving purposes (we cannot keep
the same sequence field type reference at different locations within the
metadata tree because then the resolved length field type would be the
same reference). However, the effective byte order is set on the copied
field types. If the user keeps an original field type reference, then
its byte order remains unset and the user can still create a field from
this field type. This means that the field serialization function reads
a wrong effective byte order, possibly leading to a corrupted stream
file.

This patch makes bt_ctf_trace_add_stream_class() and
bt_ctf_stream_class_add_event_class() set the effective byte order of
the original field types too.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
@dschaefer
Copy link

Cool, I tried this out on my test and it does fix my problem. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants