Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: prevent tampering with internals in `inspect()` #26577

Closed

Conversation

Projects
None yet
4 participants
@BridgeAR
Copy link
Member

BridgeAR commented Mar 10, 2019

This makes sure user options passed to util.inspect() will not
override any internal properties (besides stylize).

Fixes: #24765

Defensively marked as semver-major. @nodejs/tsc PTAL.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
util: prevent tampering with internals in `inspect()`
This makes sure user options passed to `util.inspect()` will not
override any internal properties (besides `stylize`).

@BridgeAR BridgeAR requested a review from addaleax Mar 10, 2019

@BridgeAR

This comment has been minimized.

@mcollina
Copy link
Member

mcollina left a comment

LGTM

@Trott

Trott approved these changes Mar 12, 2019

Copy link
Member

Trott left a comment

LGTM if CITGM doesn't reveal any problems

@BridgeAR

This comment has been minimized.

Copy link
Member Author

BridgeAR commented Mar 12, 2019

CI https://ci.nodejs.org/job/node-test-pull-request/21469/
CI https://ci.nodejs.org/job/node-test-pull-request/21474/
CITGM https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1760/

I just pushed another commit as I messed up a condition earlier and added a test case for that as well.

@BridgeAR

This comment has been minimized.

Copy link
Member Author

BridgeAR commented Mar 13, 2019

@BridgeAR

This comment has been minimized.

Copy link
Member Author

BridgeAR commented Mar 13, 2019

@mcollina @Trott please confirm your LG due to the fix I had to push.

@mcollina
Copy link
Member

mcollina left a comment

LGTM

BridgeAR added a commit that referenced this pull request Mar 13, 2019

util: prevent tampering with internals in `inspect()`
This makes sure user options passed to `util.inspect()` will not
override any internal properties (besides `stylize`).

PR-URL: #26577
Fixes: #24765
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BridgeAR

This comment has been minimized.

Copy link
Member Author

BridgeAR commented Mar 13, 2019

Landed in 5672ab7 🎉

@BridgeAR BridgeAR closed this Mar 13, 2019

Drieger added a commit to Drieger/node that referenced this pull request Mar 22, 2019

util: prevent tampering with internals in `inspect()`
This makes sure user options passed to `util.inspect()` will not
override any internal properties (besides `stylize`).

PR-URL: nodejs#26577
Fixes: nodejs#24765
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

@BethGriggs BethGriggs referenced this pull request Mar 26, 2019

Draft

v12.0.0 proposal #26930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.