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.11.0-rc4~41 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ab4b3982b6caebe26cc204efd432f9e1bab23a83;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 cddddb9ec..7fbb01011 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; }