Skip to content

No abort on require() with null bytes#8277

Closed
rvagg wants to merge 2 commits intonodejs:masterfrom
rvagg:null-bytes-require-abort
Closed

No abort on require() with null bytes#8277
rvagg wants to merge 2 commits intonodejs:masterfrom
rvagg:null-bytes-require-abort

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Aug 26, 2016

  1. Handle errno in InternalModuleReadFile() returning Undefined so we don't get an abort() when uv_fs_read() raises an error (currently it's only on \u0000 that I can find an error but perhaps there are others).
  2. Apply the nullBytes() check in readPackage() so we get a proper error rather than a truncated one. This is also consistent with the behaviour of require() on null bytes prior to the introduction of the fast-path reads that now exist in v4.x+.

This comes from 1bbf8d0 which is in v4.x and v6.x. In v0.12 and prior you'd get a normal "null bytes not allowed" error thrown when using a require() involving \u0000.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. module Issues and PRs related to the module subsystem. stalled Issues and PRs that are stalled.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants