[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-5.2] util/cutils: Fix bounds check at freq_to_str()
From: |
Peter Maydell |
Subject: |
Re: [PATCH for-5.2] util/cutils: Fix bounds check at freq_to_str() |
Date: |
Fri, 30 Oct 2020 09:59:17 +0000 |
On Thu, 29 Oct 2020 at 20:38, Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> Fix bounds check for idx at freq_to_str(), to actually ensure idx
> never goes beyond the last element of the suffixes array.
>
> Reported-by: Coverity (CID 1435957: OVERRUN)
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Personally I preferred the other option (remove the
idx check from the while loop and assert that idx
is in bounds after the loop)...
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
thanks
-- PMM