diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-04-09 17:33:33 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-06-06 15:07:29 -0700 |
commit | 535c7777ac674ba86cf93c44824e07b0e23ea8c4 (patch) | |
tree | 3a4ffb376febdee64f8c7567d6e60aede3120901 /src/process_wrap.cc | |
parent | 0da4c671659cfbae12def127b2e94690b9d9b5e1 (diff) | |
download | node-new-535c7777ac674ba86cf93c44824e07b0e23ea8c4.tar.gz |
src: replace usage of String::Utf8Value
v8::String::Utf8Value previously could allow invalid surrogates when
interpreting values.
Diffstat (limited to 'src/process_wrap.cc')
-rw-r--r-- | src/process_wrap.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 784300f9aa..ac63e4bea8 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -25,6 +25,7 @@ #include "tty_wrap.h" #include "tcp_wrap.h" #include "udp_wrap.h" +#include "util.h" #include <string.h> #include <stdlib.h> @@ -187,7 +188,7 @@ class ProcessWrap : public HandleWrap { // options.file Local<Value> file_v = js_options->Get(String::NewSymbol("file")); - String::Utf8Value file(file_v->IsString() ? file_v : Local<Value>()); + node::Utf8Value file(file_v->IsString() ? file_v : Local<Value>()); if (file.length() > 0) { options.file = *file; } else { @@ -202,7 +203,7 @@ class ProcessWrap : public HandleWrap { // Heap allocate to detect errors. +1 is for NULL. options.args = new char*[argc + 1]; for (int i = 0; i < argc; i++) { - String::Utf8Value arg(js_argv->Get(i)); + node::Utf8Value arg(js_argv->Get(i)); options.args[i] = strdup(*arg); } options.args[argc] = NULL; @@ -210,7 +211,7 @@ class ProcessWrap : public HandleWrap { // options.cwd Local<Value> cwd_v = js_options->Get(String::NewSymbol("cwd")); - String::Utf8Value cwd(cwd_v->IsString() ? cwd_v : Local<Value>()); + node::Utf8Value cwd(cwd_v->IsString() ? cwd_v : Local<Value>()); if (cwd.length() > 0) { options.cwd = *cwd; } @@ -222,7 +223,7 @@ class ProcessWrap : public HandleWrap { int envc = env->Length(); options.env = new char*[envc + 1]; // Heap allocated to detect errors. for (int i = 0; i < envc; i++) { - String::Utf8Value pair(env->Get(i)); + node::Utf8Value pair(env->Get(i)); options.env[i] = strdup(*pair); } options.env[envc] = NULL; |