OSDN Git Service

tests/qtest: xlnx-canfd-test: Fix code coverity issues
authorVikram Garhwal <vikram.garhwal@amd.com>
Wed, 28 Jun 2023 20:27:58 +0000 (13:27 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 6 Jul 2023 12:26:43 +0000 (13:26 +0100)
commitb52aa865259f8e26125333a178c0a9364d8ae4da
tree667405c8f8a52b3af3d6fb30a06e16922c026676
parent9719f125b803f4e0fda834cd74a60dfa4ca398e2
tests/qtest: xlnx-canfd-test: Fix code coverity issues

Following are done to fix the coverity issues:
1. Change read_data to fix the CID 1512899: Out-of-bounds access (OVERRUN)
2. Fix match_rx_tx_data to fix CID 1512900: Logically dead code (DEADCODE)
3. Replace rand() in generate_random_data() with g_rand_int()

Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
Message-id: 20230628202758.16398-1-vikram.garhwal@amd.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/qtest/xlnx-canfd-test.c