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: truncate instead of throw when writing beyond buffer #54524

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

ronag
Copy link
Member

@ronag ronag commented Aug 23, 2024

Fixes: #54523

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels Aug 23, 2024
@ronag ronag force-pushed the buffer-write-length-oob branch from e785336 to 9c112d9 Compare August 23, 2024 13:44
ronag added a commit to nxtedition/node that referenced this pull request Aug 23, 2024
@OnlyAviv
Copy link
Member

OnlyAviv commented Aug 23, 2024

@ronag I marked #54523 as a duplicate of #54521 and #54518, does this issue fix one of those too? (It looks like it might fix #54518, right?)

@ronag
Copy link
Member Author

ronag commented Aug 23, 2024

#54521 is not related to this

ronag added a commit to nxtedition/node that referenced this pull request Aug 23, 2024
@ronag ronag force-pushed the buffer-write-length-oob branch from 615fe78 to ff17b6b Compare August 23, 2024 14:05
@ronag ronag added the fast-track PRs that do not need to wait for 48 hours to land. label Aug 23, 2024
Copy link
Contributor

Fast-track has been requested by @ronag. Please 👍 to approve.

ronag added a commit to nxtedition/node that referenced this pull request Aug 23, 2024
@ronag ronag force-pushed the buffer-write-length-oob branch from ff17b6b to e94a7f2 Compare August 23, 2024 14:07
ronag added a commit to nxtedition/node that referenced this pull request Aug 23, 2024
@ronag ronag force-pushed the buffer-write-length-oob branch from e94a7f2 to f6f2334 Compare August 23, 2024 14:07
ronag added a commit to nxtedition/node that referenced this pull request Aug 23, 2024
@ronag ronag force-pushed the buffer-write-length-oob branch from f6f2334 to 9b0a26a Compare August 23, 2024 14:08
@OnlyAviv
Copy link
Member

#54521 is not related to this

But does it fix #54518?

@ronag
Copy link
Member Author

ronag commented Aug 23, 2024

#54521 is not related to this

But does it fix #54518?

I think so.

Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this, but could it be considered a major, breaking change?

@ronag
Copy link
Member Author

ronag commented Aug 23, 2024

It's unbrraking.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.34%. Comparing base (628469c) to head (fcb2906).
Report is 340 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/buffer.js 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54524      +/-   ##
==========================================
- Coverage   87.34%   87.34%   -0.01%     
==========================================
  Files         649      649              
  Lines      182576   182626      +50     
  Branches    35036    35040       +4     
==========================================
+ Hits       159467   159507      +40     
- Misses      16381    16390       +9     
- Partials     6728     6729       +1     
Files with missing lines Coverage Δ
lib/internal/buffer.js 97.41% <33.33%> (+0.26%) ⬆️

... and 37 files with indirect coverage changes

@jerome-benoit
Copy link
Contributor

jerome-benoit commented Aug 23, 2024

It's unbrraking.

Of course it is: the semantic of dependent APIs is changed. But the initial upper bound check introduction should not have go without being flagged as a breaking change.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ronag ronag added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 27, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 27, 2024
@nodejs-github-bot nodejs-github-bot merged commit dd8eeec into nodejs:main Aug 27, 2024
52 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in dd8eeec

haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Aug 27, 2024
haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Aug 27, 2024
* chore(deps-dev): update development dependencies

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Revert to Node.js 22.6.0

nodejs/node#54524

Signed-off-by: Andrew Haines <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Andrew Haines <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andrew Haines <[email protected]>
ronag added a commit to nxtedition/node that referenced this pull request Aug 27, 2024
ronag added a commit to nxtedition/node that referenced this pull request Aug 27, 2024
ronag added a commit to nxtedition/node that referenced this pull request Aug 27, 2024
@Wazbat
Copy link

Wazbat commented Aug 27, 2024

I'm unfamiliar with the node release process. Is there a rough estimate on when this will be released?

@RafaelGSS
Copy link
Member

I'm unfamiliar with the node release process. Is there a rough estimate on when this will be released?

It should go out tomorrow. Follow #54560

RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
Fixes: #54523
Fixes: #54518
PR-URL: #54524
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
Fixes: #54523
Fixes: #54518
PR-URL: #54524
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Sep 2, 2024
haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Sep 2, 2024
* chore(deps-dev): update development dependencies

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix lint errors

Signed-off-by: Andrew Haines <[email protected]>

* Revert to Node.js 22.6.0

nodejs/node#54524

Signed-off-by: Andrew Haines <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Andrew Haines <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andrew Haines <[email protected]>
@targos targos added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Sep 22, 2024
jasnell pushed a commit that referenced this pull request Sep 28, 2024
This reverts commit dd8eeec.

PR-URL: #54588
Refs: #54524
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
Fixes: nodejs#54523
Fixes: nodejs#54518
PR-URL: nodejs#54524
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
This reverts commit dd8eeec.

PR-URL: nodejs#54588
Refs: nodejs#54524
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
This reverts commit dd8eeec.

PR-URL: nodejs#54588
Refs: nodejs#54524
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. fast-track PRs that do not need to wait for 48 hours to land. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

latest release error - RangeError: "length" is outside of buffer bounds