consumer: fix: unaligned accesses to index fields
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Sep 2019 20:48:18 +0000 (16:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:48 +0000 (15:31 -0400)
commit641e88732ae04f89c397ef4400babd5a92c7397f
tree819ba4d9279c7eb71faf738bae41d89e085318ad
parent3577d7d8ecbe2ded93572fcf38ea555bd3d04722
consumer: fix: unaligned accesses to index fields

The ctf_index structure, being part of the ABI, is explicitly packed
using the LTTNG_PACKED macro. However, populating it by using pointers
to its members is not acceptable as it may cause the ust and kernel
tracer APIs to populate write their return values using unaligned
pointers.

Use automatic storage variables to fetch the various index fields and
populate the index at-once using a compound literal.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/kernel-consumer/kernel-consumer.c
src/common/ust-consumer/ust-consumer.c
This page took 0.025225 seconds and 4 git commands to generate.