Skip to content

Commit da0bb76

Browse files
Potential fix for code scanning alert no. 1: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1919c41 commit da0bb76

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/system-font.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,13 @@ SystemFont.prototype.install = function(remoteFile, fileName, callback) {
155155
});
156156
}
157157
else {
158-
child_process.exec('cscript.exe ' + path.join(__dirname, 'windows', 'installFont.js') + ' ' + tmpPath, function(err, stdout, stderr){
159-
callback(err, 'Font System Folder with cscript.');
160-
})
158+
child_process.execFile(
159+
'cscript.exe',
160+
[path.join(__dirname, 'windows', 'installFont.js'), tmpPath],
161+
function(err, stdout, stderr) {
162+
callback(err, 'Font System Folder with cscript.');
163+
}
164+
);
161165
}
162166
})
163167
break;

0 commit comments

Comments
 (0)