DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated
@ 2017-05-16 16:14 John Miller
  2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: John Miller @ 2017-05-16 16:14 UTC (permalink / raw)
  To: dev; +Cc: ed.czeck, shepard.siegel, John Miller

Coverity issue: 144512
Coverity issue: 144513
Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")

Signed-off-by: John Miller <john.miller@atomicrules.com>
---
 drivers/net/ark/ark_pktchkr.c | 2 +-
 drivers/net/ark/ark_pktgen.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 62b3673..c3040af 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -372,7 +372,7 @@ struct OPTIONS {
 			o->v.INT = atoll(val);
 			break;
 		case OTSTRING:
-			strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+			snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
 			break;
 		}
 		return 1;
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index bdac054..8c7a8a2 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -354,7 +354,7 @@ struct OPTIONS {
 			o->v.INT = atoll(val);
 			break;
 		case OTSTRING:
-			strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+			snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
 			break;
 		}
 		return 1;
-- 
1.9.1

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

end of thread, other threads:[~2017-05-16 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked John Miller
2017-05-16 16:37 ` [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated Ferruh Yigit

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