From: Jérémie Galarneau Date: Sat, 14 Sep 2019 18:31:40 +0000 (-0400) Subject: runas: fix: possible unaligned access in packed structure X-Git-Tag: v2.12.0-rc1~388 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=65eefd4c79ec8ba20a0ff2356b053c321de224aa;p=lttng-tools.git runas: fix: possible unaligned access in packed structure Fix the warning that an unaligned pointers can be passed as parameter emitted in _extract_elf_symbol_offset. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/runas.c b/src/common/runas.c index 4bdb43af3..222047cb6 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -512,15 +512,17 @@ int _extract_elf_symbol_offset(struct run_as_data *data, struct run_as_ret *ret_value) { int ret = 0; + uint64_t offset; ret_value->_error = false; ret = lttng_elf_get_symbol_offset(data->u.extract_elf_symbol_offset.fd, data->u.extract_elf_symbol_offset.function, - &ret_value->u.extract_elf_symbol_offset.offset); + &offset); if (ret) { DBG("Failed to extract ELF function offset"); ret_value->_error = true; } + ret_value->u.extract_elf_symbol_offset.offset = offset; return ret; }