[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/xtensa: Correct assert condition in handle_interrupt(
From: |
Max Filippov |
Subject: |
Re: [PATCH] target/xtensa: Correct assert condition in handle_interrupt() |
Date: |
Wed, 31 Jul 2024 10:41:57 -0700 |
On Wed, Jul 31, 2024 at 10:22 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> In commit ad18376b90c8101 we added an assert that the level value was
> in-bounds for the array we're about to index into. However, the
> assert condition is wrong -- env->config->interrupt_vector is an
> array of uint32_t, so we should bounds check the index against
> ARRAY_SIZE(...), not against sizeof().
>
> Resolves: Coverity CID 1507131
> Fixes: ad18376b90c8101 ("target/xtensa: Assert that interrupt level is within
> bounds")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Spotted because Coverity (correctly) thought the issue was still
> outstanding.
> ---
> target/xtensa/exc_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
--
Thanks.
-- Max