You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
null character as first character of path component crashes node #13787
Activity
TimothyGu commentedon Jun 19, 2017
I can't reproduce this:
bnoordhuis commentedon Jun 19, 2017
I suspect it should be
\u0000, not\u0001?vsemozhetbyt commentedon Jun 19, 2017
I cannot reproduce on Windows 7 x64 with these versions:
(click me):
Ginden commentedon Jun 19, 2017
I can reproduce on Node v6.10.3 on OS X.
module: ignore module path after null character
module: ignore module path after null character
charmander commentedon Jun 19, 2017
@vsemozhetbyt How about this?
$ node -e 'require("./\0abc")'vsemozhetbyt commentedon Jun 19, 2017
@charmander I've reverted the quotes as node sees your variant as a string:
(click me):
module: ignore module path after null character
module: ignore module path after null character
bnoordhuis commentedon Jun 27, 2017
For anyone stumbling upon this issue, in-progress pull request here: #13788
zimbabao commentedon Jul 3, 2017
There is one more pull requests is here(#8277)
hubbertj commentedon Aug 16, 2017
Still present in v8.4.0!
error:
node -e "require('\u0000abc')"
/Users/Jay/.nvm/versions/node/v8.4.0/bin/node[22326]: ../src/node_file.cc:530:void node::InternalModuleReadFile(const FunctionCallbackInfov8::Value &): Assertion `(numchars) >= (0)' failed.
1: node::Abort() [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
2: node::MakeCallback(v8::Isolate*, v8::Localv8::Object, char const*, int, v8::Localv8::Value, node::async_context) [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
3: node::InternalModuleReadFile(v8::FunctionCallbackInfov8::Value const&) [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
4: v8::internal::FunctionCallbackArguments::Call(void ()(v8::FunctionCallbackInfov8::Value const&)) [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
5: v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, v8::internal::BuiltinArguments) [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/Jay/.nvm/versions/node/v8.4.0/bin/node]
7: 0x383b32c840dd
[1] 22326 abort node -e "require('\u0000abc')"
nvm use v6.0.0
Now using node v6.0.0 (npm v3.8.6)
node -e "require('\u0000abc')"
Assertion failed: ((numchars) >= (0)), function InternalModuleReadFile, file ../src/node_file.cc, line 553.
[1] 23589 abort node -e "require('\u0000abc')"
src: detect nul bytes in InternalModuleReadFile()
src: detect nul bytes in InternalModuleReadFile()
src: detect nul bytes in InternalModuleReadFile()
src: detect nul bytes in InternalModuleReadFile()
src: detect nul bytes in InternalModuleReadFile()