Skip to content

Commit a0a2394

Browse files
authored
Merge pull request #14 from akabarki76/alert-autofix-9
Potential fix for code scanning alert no. 9: Unsafe shell command constructed from library input
2 parents 965a23d + 0b532c1 commit a0a2394

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/utils/editor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { execSync, spawn } from 'child_process';
8+
import * as shellQuote from 'shell-quote';
89

910
export type EditorType =
1011
| 'vscode'
@@ -126,8 +127,8 @@ export function getDiffCommand(
126127
// Auto close all windows when one is closed
127128
'-c',
128129
'autocmd WinClosed * wqa',
129-
oldPath,
130-
newPath,
130+
shellQuote.quote([oldPath]),
131+
shellQuote.quote([newPath]),
131132
],
132133
};
133134
default:

0 commit comments

Comments
 (0)