Datasets:

Modalities:
Text
Formats:
json
Languages:
code
Size:
< 1K
Tags:
code
Libraries:
Datasets
pandas
License:
File size: 571 Bytes
eb67da4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * @overview Contains functionality specifically for Windows systems.
 * @license MPL-2.0
 * @author Eric Cornelissen <ericornelissen@gmail.com>
 */

/**
 * Escape a shell argument.
 *
 * @param {string} arg The argument to escape.
 * @returns {string} The escaped argument.
 */
function escapeShellArg(arg) {
  // BUG: CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
  // return arg.replace(/"/g, `""`);
  // FIXED:
  return arg.replace(/\u{0}/gu, "").replace(/"/g, `""`);
}

module.exports.escapeShellArg = escapeShellArg;