summaryrefslogtreecommitdiffstats
path: root/hw/core/loader.c
diff options
context:
space:
mode:
authorStefano Garzarella2019-09-10 16:22:23 +0200
committerPaolo Bonzini2019-09-16 12:32:21 +0200
commit41a2635124117d1fac7e45b3cafa2c1ac68417fd (patch)
tree9672ab00b04fc3e7720aeb1a99574b883bb6f87a /hw/core/loader.c
parenthw/i386: Move CONFIG_ACPI_PCI to CONFIG_PC (diff)
downloadqemu-41a2635124117d1fac7e45b3cafa2c1ac68417fd.tar.gz
qemu-41a2635124117d1fac7e45b3cafa2c1ac68417fd.tar.xz
qemu-41a2635124117d1fac7e45b3cafa2c1ac68417fd.zip
elf-ops.h: fix int overflow in load_elf()
This patch fixes a possible integer overflow when we calculate the total size of ELF segments loaded. Reported-by: Coverity (CID 1405299) Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20190910124828.39794-1-sgarzare@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/loader.c')
-rw-r--r--hw/core/loader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 32f7cc7c33..75eb56ddbb 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -338,6 +338,8 @@ const char *load_elf_strerror(int error)
return "The image is from incompatible architecture";
case ELF_LOAD_WRONG_ENDIAN:
return "The image has incorrect endianness";
+ case ELF_LOAD_TOO_BIG:
+ return "The image segments are too big to load";
default:
return "Unknown error";
}