Skip to content

Commit cf003ac

Browse files
chore: Replace execSync with execFileSync to prevent command injection in clang-format script (#30)
1 parent 82e89e5 commit cf003ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/clang-format.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import child_process from 'child_process';
22

33
const args = ['--Werror', '-i', '--style=file', 'module.cc'];
4-
const cmd = `./node_modules/.bin/clang-format ${args.join(' ')}`;
54

65
try {
7-
child_process.execSync(cmd, {stdio: 'inherit'});
6+
child_process.execFileSync('./node_modules/.bin/clang-format', args, {stdio: 'inherit'});
87
} catch (e) {
98
// This fails on linux_arm64
109
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)