DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/eventdev: fix sprintf with snprintf
@ 2019-02-06 10:43 Pallantla Poornima
  2019-02-08 21:19 ` Aaron Conole
  0 siblings, 1 reply; 14+ messages in thread
From: Pallantla Poornima @ 2019-02-06 10:43 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, nikhil.rao, Pallantla Poornima, stable

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>
---
 test/test/test_event_eth_rx_adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c
index 1d3be82b5..38f5c039f 100644
--- a/test/test/test_event_eth_rx_adapter.c
+++ b/test/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);
-- 
2.17.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-04-02  1:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 10:43 [dpdk-dev] [PATCH] test/eventdev: fix sprintf with snprintf Pallantla Poornima
2019-02-08 21:19 ` Aaron Conole
     [not found]   ` <7AE31235A30B41498D1C31348DC858BD5B534A73@IRSMSX103.ger.corp.intel.com>
2019-03-12  7:41     ` Parthasarathy, JananeeX M
2019-03-12 14:44       ` Aaron Conole
2019-03-13 11:04         ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-03-13 13:43           ` Aaron Conole
2019-03-13 14:07             ` Ferruh Yigit
2019-03-13 14:35               ` Aaron Conole
2019-03-30 14:15                 ` Jerin Jacob Kollanukkaran
2019-03-30 14:15                   ` Jerin Jacob Kollanukkaran
2019-04-01 20:37                   ` Aaron Conole
2019-04-01 20:37                     ` Aaron Conole
2019-04-02  1:35                     ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-04-02  1:35                       ` Jerin Jacob Kollanukkaran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).