]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Only memcpy ehdr back when not already directly mmapped.
authorMark Wielaard <mjw@redhat.com>
Fri, 8 Nov 2013 18:28:16 +0000 (19:28 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 11 Nov 2013 14:07:44 +0000 (15:07 +0100)
commit3ba50403179131d6153923af71d00a909b62a147
treef77cf7108b35ceb22468df12bdfdc5d1d50b9ba6
parent03d76f4aec5e750b81198c7a24571e119e754b40
libelf: Only memcpy ehdr back when not already directly mmapped.

When the elf file is mmapped ehdr can still point to ehdr_mem if the
address is unaligned.  In such cases we do need to memcpy the ehdr back
to the file. We shouldn't when ehdr already comes directly from the mmapped
file, because that would cause an memcpy call with overlapping addresses
(ehdr being copied directly over itself).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf32_updatefile.c