pc: check for underflow in load_linux
commitec5fd402645fd4f03d89dcd5840b0e8542549e82
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Sep 2015 10:07:22 +0000 (14 12:07 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 8 Oct 2015 16:46:01 +0000 (8 19:46 +0300)
tree436f86413a54a3a7726cd477dee86a935ec1dd70
parent16033ba577059c5675e4c786234c46027380c29b
pc: check for underflow in load_linux

If (setup_size+1)*512 is small enough, kernel_size -= setup_size can allocate
a huge amount of memory.  Avoid that.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/i386/pc.c