Skip to content

Commit d8549fd

Browse files
authored
Merge pull request #10 from akabarki76/alert-autofix-11
Potential fix for code scanning alert no. 11: Unsafe shell command constructed from library input
2 parents b2da0d8 + 5f11e3a commit d8549fd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/core/src/utils/editor.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,8 @@ export async function openDiff(
181181
case 'vim':
182182
case 'neovim': {
183183
// Use execSync for terminal-based editors
184-
const command =
185-
process.platform === 'win32'
186-
? `${diffCommand.command} ${diffCommand.args.join(' ')}`
187-
: `${diffCommand.command} ${diffCommand.args.map((arg) => `"${arg}"`).join(' ')}`;
188-
execSync(command, {
184+
const args = diffCommand.args;
185+
execFileSync(diffCommand.command, args, {
189186
stdio: 'inherit',
190187
encoding: 'utf8',
191188
});

0 commit comments

Comments
 (0)