patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] app/procinfo: fix strncpy count issue
@ 2018-02-20 12:57 Radu Nicolau
  2018-02-20 13:00 ` [dpdk-stable] [PATCH v2] " Radu Nicolau
  2018-02-20 13:29 ` [dpdk-stable] [dpdk-dev] [PATCH] " Bruce Richardson
  0 siblings, 2 replies; 6+ messages in thread
From: Radu Nicolau @ 2018-02-20 12:57 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, maryam.tahhan, reshma.pattan, Radu Nicolau, stable

Change strncpy count parameter to MAX_LONG_OPT_SZ-1 to avoid
overwriting the last NULL character and for consistency.

Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
Coverity issue: 30688

Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 app/proc_info/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/proc_info/main.c b/app/proc_info/main.c
index 2f53e3c..5f0b745 100644
--- a/app/proc_info/main.c
+++ b/app/proc_info/main.c
@@ -159,7 +159,7 @@ proc_info_preparse_args(int argc, char **argv)
 				proc_info_usage(prgname);
 				return -1;
 			}
-			strncpy(host_id, argv[i+1], sizeof(host_id));
+			strncpy(host_id, argv[i+1], MAX_LONG_OPT_SZ-1);
 		}
 	}
 
-- 
2.7.5

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

end of thread, other threads:[~2018-03-27 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 12:57 [dpdk-stable] [PATCH] app/procinfo: fix strncpy count issue Radu Nicolau
2018-02-20 13:00 ` [dpdk-stable] [PATCH v2] " Radu Nicolau
2018-02-20 13:52   ` [dpdk-stable] [PATCH v3] " Radu Nicolau
2018-02-20 14:16     ` Bruce Richardson
2018-03-27 22:25       ` Thomas Monjalon
2018-02-20 13:29 ` [dpdk-stable] [dpdk-dev] [PATCH] " 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).