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

buffer: fix crash for invalid index types #25154

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

This is a forward-port of v10.x’s #23795, which was originally targeting master, to fix #23668.

As part of the discussion back then, we wanted to explore a “fix” for v11.x and master that involved introducing typechecking along the lines of #23840, but since that hasn’t happened, it seems like a good idea to apply this on all affected branches, in order to make sure the bug is fixed everywhere.

This does not keep #23840 from happening in any way (except that this makes it a semver-major PR).


2555cb4 introduced a crash
when a non-number value was passed to ParseArrayIndex().

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: #22129
Fixes: #23668

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

2555cb4 introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: nodejs#22129
Fixes: nodejs#23668
@addaleax addaleax added buffer Issues and PRs related to the buffer subsystem. dont-land-on-v8.x labels Dec 20, 2018
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Dec 20, 2018
@addaleax
Copy link
Member Author

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 26, 2018
@addaleax
Copy link
Member Author

@addaleax
Copy link
Member Author

addaleax commented Dec 30, 2018

@addaleax
Copy link
Member Author

Landed in 76ecec2

@addaleax addaleax closed this Dec 31, 2018
@addaleax addaleax deleted the forward-port-23795 branch December 31, 2018 00:16
addaleax added a commit that referenced this pull request Dec 31, 2018
2555cb4 introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: #22129
Fixes: #23668

PR-URL: #25154
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jan 1, 2019
2555cb4 introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: #22129
Fixes: #23668

PR-URL: #25154
Reviewed-By: James M Snell <jasnell@gmail.com>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
2555cb4 introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: nodejs#22129
Fixes: nodejs#23668

PR-URL: nodejs#25154
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

src\node_buffer.cc:173: Assertion `arg->IsNumber()' failed.
3 participants