DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/distributor: fix sprintf with snprintf
@ 2019-02-06 10:39 Pallantla Poornima
  2019-02-06 10:48 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Pallantla Poornima @ 2019-02-06 10:39 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, david.hunt, Pallantla Poornima, stable

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: f74df2c57e ("test/distributor: test single and burst API")
Cc: stable@dpdk.org

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
---
 test/test/test_distributor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/test/test_distributor.c b/test/test/test_distributor.c
index 98919ec0c..03df32b05 100644
--- a/test/test/test_distributor.c
+++ b/test/test/test_distributor.c
@@ -642,9 +642,11 @@ test_distributor(void)
 
 		worker_params.dist = dist[i];
 		if (i)
-			sprintf(worker_params.name, "burst");
+			snprintf(worker_params.name,
+					sizeof(worker_params.name), "burst");
 		else
-			sprintf(worker_params.name, "single");
+			snprintf(worker_params.name,
+					sizeof(worker_params.name), "single");
 
 		rte_eal_mp_remote_launch(handle_work,
 				&worker_params, SKIP_MASTER);
-- 
2.17.2

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

end of thread, other threads:[~2019-02-06 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06 10:39 [dpdk-dev] [PATCH] test/distributor: fix sprintf with snprintf Pallantla Poornima
2019-02-06 10:48 ` Bruce Richardson

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).