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>
Sat, 14 Sep 2019 15:50:48 +0000 (11:50 -0400)
commit85d1db9fbef6b3e6148bbaf3235b01d446c6c07f
treecb70fe79d2c1d639a2889119e9b488847992beee
parent58f835e108c72cf830c4bc3d5b6abce80ebb0b6c
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.025102 seconds and 4 git commands to generate.