提交 ee71c984 编写于 作者: P Peter Maydell 提交者: Anthony Liguori

hw/arm_timer.c: Fix bounds check for Integrator timer accesses

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: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 afd4a652
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册