summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPallantla Poornima <pallantlax.poornima@intel.com>2019-02-06 10:43:42 +0000
committerJerin Jacob <jerinj@marvell.com>2019-04-02 07:02:56 +0530
commit7a1ccc24874e251957513aba0520500f873e276a (patch)
treef7f7c26e780af6879c17dd1234fdcc11d98d1a1f
parent13140e4af8ebc1d3ff5cb8cf16f5b998dd0dfbab (diff)
downloaddpdk-next-eventdev-7a1ccc24874e251957513aba0520500f873e276a.zip
dpdk-next-eventdev-7a1ccc24874e251957513aba0520500f873e276a.tar.gz
dpdk-next-eventdev-7a1ccc24874e251957513aba0520500f873e276a.tar.xz
test/eventdev: fix sprintf with snprintf
sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used. Fixes: 2a9c83ae3b ("test/eventdev: add multi-ports test") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
-rw-r--r--app/test/test_event_eth_rx_adapter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 1d3be82..38f5c03 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -479,7 +479,8 @@ adapter_multi_eth_add_del(void)
/* add the max port for rx_adapter */
port_index = rte_eth_dev_count_total();
for (; port_index < RTE_MAX_ETHPORTS; port_index += 1) {
- sprintf(driver_name, "%s%u", "net_null", drv_id);
+ snprintf(driver_name, sizeof(driver_name), "%s%u", "net_null",
+ drv_id);
err = rte_vdev_init(driver_name, NULL);
TEST_ASSERT(err == 0, "Failed driver %s got %d",
driver_name, err);