src: fix escaping of single quotes in task runner · nodejs/node@ce659a1 · GitHub
Skip to content

Commit ce659a1

Browse files
committed
src: fix escaping of single quotes in task runner
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #64089 Refs: https://hackerone.com/reports/3817602 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 0b6af91 commit ce659a1

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/node_task_runner.cc

Lines changed: 2 additions & 2 deletions

test/cctest/test_node_task_runner.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ TEST_F(TaskRunnerTest, EscapeShell) {
2828
{"test words", "'test words'"},
2929
{"$1", "'$1'"},
3030
{"\"$1\"", "'\"$1\"'"},
31-
{"'$1'", "'\\'$1\\''"},
31+
{"'$1'", "\"'\"'$1'\"'\"''"},
3232
{"\\$1", "'\\$1'"},
3333
{"--arg=\"$1\"", "'--arg=\"$1\"'"},
3434
{"--arg=node exec -c \"$1\"", "'--arg=node exec -c \"$1\"'"},
35-
{"--arg=node exec -c '$1'", "'--arg=node exec -c \\'$1\\''"},
36-
{"'--arg=node exec -c \"$1\"'", "'\\'--arg=node exec -c \"$1\"\\''"}
35+
{"--arg=node exec -c '$1'", "'--arg=node exec -c '\"'\"'$1'\"'\"''"},
36+
{"'--arg=node exec -c \"$1\"'", "\"'\"'--arg=node exec -c \"$1\"'\"'\"''"}
3737
#endif
3838
};
3939

test/fixtures/run-script/node_modules/.bin/positional-args

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/run-script/node_modules/.bin/positional-args.bat

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/parallel/test-node-run.js

Lines changed: 4 additions & 4 deletions

0 commit comments

Comments
 (0)