Commit f40c3e98 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

check_format: add [v]sprintf() to banned functions



Fix up the single instance in the tree (dmaperf.c example) and
disallow more string functions with no destination buffer size.

Change-Id: I2bd39d6e848cd8a13536e26c4f0ee6713cf6dff9
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406829


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 85199c89
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -605,7 +605,7 @@ static int perf_debugfs_setup(struct perf_ctx *perf)

	for (i = 0; i < MAX_THREADS; i++) {
		struct pthr_ctx *pctx = &perf->pthr_ctx[i];
		sprintf(temp_name, "thread_%d", i);
		snprintf(temp_name, sizeof(temp_name), "thread_%d", i);

		pctx->debugfs_thr_dir = debugfs_create_dir(temp_name, perf->debugfs_node_dir);
		if (!pctx->debugfs_thr_dir) {
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ rm -f whitespace.log

echo -n "Checking for use of forbidden library functions..."

git grep -w strcpy -- app examples lib test > badfunc.log || true
git grep -w '\(strcpy\|sprintf\|vsprintf\)' -- app examples lib test > badfunc.log || true

if [ -s badfunc.log ]; then
	echo " Forbidden library functions detected"