mirror of git://sourceware.org/git/glibc.git
x86_64: Fix UB on plt rewrite
The elf/tst-plt-rewrite2 and elf/tst-plt-rewrite2 triggers the failures with ubsan: UBSAN: Undefined behaviour in ../sysdeps/x86_64/dl-machine.h:637:39 store to misaligned address 0x00007adb50230021 for type 'uint32_t'
This commit is contained in:
parent
84c6cfb9b6
commit
8cc687cbac
|
|
@ -633,7 +633,7 @@ x86_64_rewrite_plt (struct link_map *map, ElfW(Addr) plt_rewrite)
|
|||
|
||||
/* Write out direct branch. */
|
||||
*(uint8_t *) branch_start = JMP32_INSN_OPCODE;
|
||||
*(uint32_t *) (branch_start + 1) = disp;
|
||||
memcpy ((void *)(branch_start + 1), &disp, sizeof (uint32_t));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue