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>
Sat, 14 Sep 2019 20:33:48 +0000 (16:33 -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 4bdb43af38da4fbf822944237caa18cfcbe30926..222047cb60422023031f5a531879d166edccb154 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.02709 seconds and 4 git commands to generate.