projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c37e1b7
)
node: fix argument parsing with -p arg
author
Alexis Campailla
<alexis@janeasystems.com>
Sat, 28 Dec 2013 08:12:40 +0000
(15:12 +0700)
committer
Timothy J Fontaine
<tjfontaine@gmail.com>
Mon, 27 Jan 2014 19:54:53 +0000
(11:54 -0800)
node -p would cause an access violation.
Fixes test\message\stdin_messages.js on Windows.
src/node.cc
patch
|
blob
|
history
diff --git
a/src/node.cc
b/src/node.cc
index
47ef87b
..
0b3697d
100644
(file)
--- a/
src/node.cc
+++ b/
src/node.cc
@@
-2867,7
+2867,9
@@
static void ParseArgs(int* argc,
fprintf(stderr, "%s: %s requires an argument\n", argv[0], arg);
exit(9);
}
- } else if (argv[index + 1] != NULL && argv[index + 1][0] != '-') {
+ } else if ((index + 1 < nargs) &&
+ argv[index + 1] != NULL &&
+ argv[index + 1][0] != '-') {
args_consumed += 1;
eval_string = argv[index + 1];
if (strncmp(eval_string, "\\-", 2) == 0) {