diff --git a/examples/ioat/kperf/kmod/dmaperf.c b/examples/ioat/kperf/kmod/dmaperf.c index 4892c27e3..430adde00 100644 --- a/examples/ioat/kperf/kmod/dmaperf.c +++ b/examples/ioat/kperf/kmod/dmaperf.c @@ -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) { diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 2c7badc17..edea664a9 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -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"