镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@kylo5aby

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

Activity

  1. kylo5aby commented on Mar 26, 2024

    @kylo5aby
    ContributorAuthor

    I will try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    string_decoderIssues and PRs related to the string_decoder subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions