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

Pass an empty buffer to Buffer.alloc filling will cause not responding and high CPU usage #18128

Closed
zbinlin opened this issue Jan 13, 2018 · 0 comments
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs. security Issues and PRs related to security.

Comments

@zbinlin
Copy link
Contributor

zbinlin commented Jan 13, 2018

  • Version: 9.4.0
  • Platform: Arch Linux
Buffer.alloc(1, Buffer.alloc(0));
@TimothyGu TimothyGu added confirmed-bug Issues with confirmed bugs. buffer Issues and PRs related to the buffer subsystem. security Issues and PRs related to security. labels Jan 13, 2018
cjihrig added a commit to cjihrig/node that referenced this issue Jan 17, 2018
Prior to this commit, Node would enter an infinite loop when
attempting to fill a non-zero length buffer with a zero length
buffer. This commit introduces a thrown exception in this scenario.

PR-URL: nodejs#18129
Fixes: nodejs#18128
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
cjihrig added a commit to cjihrig/node that referenced this issue Jan 17, 2018
This commit reorders the function level changelogs of
Buffer.prototype.fill() and Buffer.alloc() to reflect the order
in which the entries were added.

PR-URL: nodejs#18129
Fixes: nodejs#18128
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs. security Issues and PRs related to security.
Projects
None yet
Development

No branches or pull requests

2 participants