memmove instead of overlapping memcpy
This commit is contained in:
+1
-1
@@ -220,7 +220,7 @@ void PackLinuxElf32::pack3(OutputFile *fo, Filter &ft)
|
|||||||
// Rotate to highest position, so it can be lopped
|
// Rotate to highest position, so it can be lopped
|
||||||
// by decrementing e_phnum.
|
// by decrementing e_phnum.
|
||||||
memcpy((unsigned char *)ibuf, phdr, sizeof(*phdr));
|
memcpy((unsigned char *)ibuf, phdr, sizeof(*phdr));
|
||||||
memcpy(phdr, 1+phdr, j * sizeof(*phdr));
|
memmove(phdr, 1+phdr, j * sizeof(*phdr)); // overlapping
|
||||||
memcpy(&phdr[j], (unsigned char *)ibuf, sizeof(*phdr));
|
memcpy(&phdr[j], (unsigned char *)ibuf, sizeof(*phdr));
|
||||||
--phdr;
|
--phdr;
|
||||||
set_te16(&ehdri.e_phnum, --e_phnum);
|
set_te16(&ehdri.e_phnum, --e_phnum);
|
||||||
|
|||||||
Reference in New Issue
Block a user