qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator timer accesses
Date: Fri, 11 Nov 2011 13:46:32 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

On 11/11/2011 07:30 AM, Peter Maydell wrote:
There are only three counter/timers on the integrator board:
correct the bounds check to avoid an array overrun. (Spotted
by Coverity, see bug 887883).

Signed-off-by: Peter Maydell<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---
  hw/arm_timer.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 09a4b24..66db81d 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -269,7 +269,7 @@ static uint64_t icp_pit_read(void *opaque, 
target_phys_addr_t offset,

      /* ??? Don't know the PrimeCell ID for this device.  */
      n = offset>>  8;
-    if (n>  3) {
+    if (n>  2) {
          hw_error("sp804_read: Bad timer %d\n", n);
      }

@@ -283,7 +283,7 @@ static void icp_pit_write(void *opaque, target_phys_addr_t 
offset,
      int n;

      n = offset>>  8;
-    if (n>  3) {
+    if (n>  2) {
          hw_error("sp804_write: Bad timer %d\n", n);
      }





reply via email to

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