test/compress: fix buffer overflow
authorRebecca Troy <rebecca.troy@intel.com>
Fri, 17 Sep 2021 15:12:07 +0000 (15:12 +0000)
committerAkhil Goyal <gakhil@marvell.com>
Tue, 28 Sep 2021 06:43:57 +0000 (08:43 +0200)
commit96fe84f42a361382b89f462873edae7c1236c303
tree53f740bb9afc7e7232fa512c42efd897e5ef6d49
parentbe5aa65c26976f03b301f9d47d8f2be220c6e362
test/compress: fix buffer overflow

Fixes stack buffer overflow bug in compressdev autotest, which
was caused by the use of buf_idx in the debug logs. Originally, buf_idx
was treated as an array instead of the reference of an integer.
This was fixed by replacing the use of buf_idx[priv_data->orig_idx] with
the variable i.

Fixes: 466a2c4bb5f4 ("test/compress: improve debug logs")
Fixes: 6bbc5a923625 ("test/compress: refactor unit tests")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
app/test/test_compressdev.c