git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fada696
)
app/procinfo: fix strncpy usage in args parsing
author
Radu Nicolau
<radu.nicolau@intel.com>
Tue, 20 Feb 2018 13:52:22 +0000
(13:52 +0000)
committer
Thomas Monjalon
<thomas@monjalon.net>
Tue, 27 Mar 2018 22:35:37 +0000
(
00:35
+0200)
Replace strncpy with snprintf to avoid overwriting the last
NULL character.
Coverity issue: 143252
Fixes:
2deb6b5246d7
("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
app/proc-info/main.c
patch
|
blob
|
history
diff --git
a/app/proc-info/main.c
b/app/proc-info/main.c
index
2f53e3c
..
f90c144
100644
(file)
--- 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;
}
- s
trncpy(host_id, argv[i+1], sizeof(host_id)
);
+ s
nprintf(host_id, sizeof(host_id), "%s", argv[i+1]
);
}
}