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

StringDecoder.write() doesn't report error when buffer length exceeds max integer value #52214

Closed
kylo5aby opened this issue Mar 26, 2024 · 1 comment
Labels
string_decoder Issues and PRs related to the string_decoder subsystem.

Comments

@kylo5aby
Copy link
Contributor

Version

21.6.0

Platform

Linux benchmark-S2600WFT 5.15.0-41-generic #44-Ubuntu x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

const { StringDecoder } = require('node:string_decoder');
const buf = Buffer.allocUnsafeSlow(2 ** 31);
console.log(decoder.write(buf).length); // 0

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

When executing console.log(decoder.write(buf).length);, expect throw an string longer error instead of output 0

What do you see instead?

output: 0

Additional information

No response

@kylo5aby
Copy link
Contributor Author

I will try to fix it.

@mertcanaltin mertcanaltin added the string_decoder Issues and PRs related to the string_decoder subsystem. label Mar 26, 2024
@jasnell jasnell closed this as completed in 8123be1 May 4, 2024
Ch3nYuY pushed a commit to Ch3nYuY/node that referenced this issue May 8, 2024
PR-URL: nodejs#52215
Fixes: nodejs#52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this issue May 8, 2024
PR-URL: #52215
Fixes: #52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
marco-ippolito pushed a commit that referenced this issue Jun 17, 2024
PR-URL: #52215
Fixes: #52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
eliphazbouye pushed a commit to eliphazbouye/node that referenced this issue Jun 20, 2024
PR-URL: nodejs#52215
Fixes: nodejs#52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
bmeck pushed a commit to bmeck/node that referenced this issue Jun 22, 2024
PR-URL: nodejs#52215
Fixes: nodejs#52214
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
string_decoder Issues and PRs related to the string_decoder subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants