]> git.ipfire.org Git - thirdparty/qemu.git/commit
dump: Fix writing of ELF section
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 24 Mar 2020 17:36:30 +0000 (17:36 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 10 Jun 2020 02:09:12 +0000 (21:09 -0500)
commit25fcaed9a366314c21793e14624c89db75224b50
tree2bafd25f33f68e2bb661bfd26e5dd9e3a609d902
parentaabd9ddd2de63cdd0189fb00fad1012abfc46d12
dump: Fix writing of ELF section

In write_elf_section() we set the 'shdr' pointer to point to local
structures shdr32 or shdr64, which we fill in to be written out to
the ELF dump.  Unfortunately the address we pass to fd_write_vmcore()
has a spurious '&' operator, so instead of writing out the section
header we write out the literal pointer value followed by whatever is
on the stack after the 'shdr' local variable.

Pass the correct address into fd_write_vmcore().

Spotted by Coverity: CID 1421970.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200324173630.12221-1-peter.maydell@linaro.org
(cherry picked from commit 174d2d6856bf435f4f58e9303ba30dd0e1279d3f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
dump/dump.c