diff options
author | Eric Auger <eric.auger@redhat.com> | 2023-11-10 09:36:54 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-11-13 11:35:47 +0100 |
commit | 2e990d81d9813628148f64b944691b5cbc251fab (patch) | |
tree | 58e9df9c3f90f755a1038cce2a2c15fc758fb851 /qemu-io.c | |
parent | 00ac955b06b28803319159551bfed6a130f8ec2f (diff) | |
download | qemu-2e990d81d9813628148f64b944691b5cbc251fab.zip qemu-2e990d81d9813628148f64b944691b5cbc251fab.tar.gz qemu-2e990d81d9813628148f64b944691b5cbc251fab.tar.bz2 |
test-resv-mem: Fix CID 1523911
Coverity complains about passing "&expected" to "run_range_inverse_array",
which dereferences null "expected". I guess the problem is that the
compare_ranges() loop dereferences 'e' without testing it. However the
loop condition is based on 'ranges' which is garanteed to have
the same length as 'expected' given the g_assert_cmpint() just
before the loop. So the code looks safe to me.
Nevertheless adding a test on expected before the loop to get rid of the
warning.
Fixes: CID 1523901
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Coverity (CID 1523901)
Message-ID: <20231110083654.277345-1-eric.auger@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'qemu-io.c')
0 files changed, 0 insertions, 0 deletions