runas: fix: possible unaligned access in packed structure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 18:31:40 +0000 (14:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:48 +0000 (15:31 -0400)
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 <jeremie.galarneau@efficios.com>
src/common/runas.c

index cddddb9ecb99f35e978e34ee30e1797936195c2a..7fbb010115673827f68b0bb8e11fb8a5ed76c5d5 100644 (file)
@@ -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;
 }
This page took 0.026898 seconds and 4 git commands to generate.