Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-04 Thread Peter Maydell
On Wed, 4 Aug 2021 at 09:35, Markus Armbruster wrote: > > Paolo Bonzini writes: > > > On 02/08/21 14:36, Peter Maydell wrote: > >> Reviewed-by: Peter Maydell > >> The real g_malloc_n() returns failure if the multiplication > >> would overflow; > > Really? Its documentation: > > This function

Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-04 Thread Markus Armbruster
Paolo Bonzini writes: > On 02/08/21 14:36, Peter Maydell wrote: >> Reviewed-by: Peter Maydell >> The real g_malloc_n() returns failure if the multiplication >> would overflow; Really? Its documentation: This function is similar to g_malloc(), allocating (n_blocks * n_block_bytes) bytes

Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-02 Thread Paolo Bonzini
On 02/08/21 14:36, Peter Maydell wrote: Reviewed-by: Peter Maydell The real g_malloc_n() returns failure if the multiplication would overflow; I guess Coverity currently doesn't have any warnings it generates as a result of assuming overflow might happen? I couldn't find any Coverity-specific

Re: [PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-08-02 Thread Peter Maydell
On Sat, 31 Jul 2021 at 07:31, Paolo Bonzini wrote: > > sz is only used in one place, so replace it with nmemb * size in > that one place. > > Signed-off-by: Paolo Bonzini > --- > scripts/coverity-scan/model.c | 13 +++-- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a

[PATCH 4/6] coverity-model: clean up the models for array allocation functions

2021-07-30 Thread Paolo Bonzini
sz is only used in one place, so replace it with nmemb * size in that one place. Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/model.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/coverity-scan/model.c b/scripts/coverity-scan/model.c index 1