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

commented Dec 20, 2018

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
buffer: fix crash for invalid index types
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
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 26, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 27, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 30, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 31, 2018

Landed in 76ecec2

@addaleax addaleax closed this Dec 31, 2018

@addaleax addaleax deleted the addaleax:forward-port-23795 branch Dec 31, 2018

addaleax added a commit that referenced this pull request Dec 31, 2018
buffer: fix crash for invalid index types
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 added a commit that referenced this pull request Jan 1, 2019
buffer: fix crash for invalid index types
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 added a commit to refack/node that referenced this pull request Jan 14, 2019
buffer: fix crash for invalid index types
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 referenced this pull request Jan 16, 2019
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.