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, 26 Sep 2019 19:39:56 +0000 (15:39 -0400)
commit18a9df278ae11194786b85de5e3135a357e4959e
tree8bbdc01d2b4e15aeda594fc8cfa80ef1129409e5
parentf3c5f4ac7837bb48fe0f6eb48e382455888dd0d1
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.02508 seconds and 4 git commands to generate.