qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loading


From: Mark Langsdorf
Subject: [Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loading
Date: Fri, 9 Mar 2012 09:57:40 -0600

Since the ram_size field of arm_boot_info is only an int, don't set
that field to more than INT_MAX. Signed vs unsigned comparison
overruns are possible otherwise.

Signed-off-by: Mark Langsdorf <address@hidden>
---
 hw/highbank.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/highbank.c b/hw/highbank.c
index 489c00e..577284a 100644
--- a/hw/highbank.c
+++ b/hw/highbank.c
@@ -306,7 +306,7 @@ static void highbank_init(ram_addr_t ram_size,
         sysbus_connect_irq(sysbus_from_qdev(dev), 2, pic[82]);
     }
 
-    highbank_binfo.ram_size = ram_size;
+    highbank_binfo.ram_size = (ram_size < INT_MAX ? ram_size : INT_MAX);
     highbank_binfo.kernel_filename = kernel_filename;
     highbank_binfo.kernel_cmdline = kernel_cmdline;
     highbank_binfo.initrd_filename = initrd_filename;
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]