[Top][All Lists]
[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
[Qemu-devel] [PATCH v2] use an unsigned long for the max_sz parameter in load_image_targphys, Mark Langsdorf, 2012/03/09
[Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loading,
Mark Langsdorf <=
[Qemu-devel] [PATCH v3] use an uint64_t for the max_sz parameter in load_image_targphys, Mark Langsdorf, 2012/03/12
Re: [Qemu-devel] [PATCH v3] use an uint64_t for the max_sz parameter in load_image_targphys, Alexander Graf, 2012/03/12