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

Buffer.alloc(): uninitialized buffer with an incorrectly encoded fill value #17423

Description

@vic511

Executing this script leads to buf being uninitialized.

let buf = Buffer.alloc(0x100, "This is not correctly encoded", "hex");
console.log(buf);

PoC

I highly suspect this is because Buffer.alloc() calls buffer.fill() after allocating memory, which doesn't fill the buffer when it cannot decode the value parameter.

Activity

  1. changed the title [-]Buffer.alloc(): uninitialized buffer when giving an incorrectly encoded fill value[/-] [+]Buffer.alloc(): uninitialized buffer with an incorrectly encoded fill value[/+] on Dec 2, 2017
  2. added
    bufferIssues and PRs related to the buffer subsystem.
    on Dec 2, 2017
  3. deleted a comment from mhdawson on Dec 5, 2017
  4. deleted a comment from mhdawson on Dec 5, 2017
  5. added a commit that references this issue on Dec 6, 2017
  6. Trott commented on Dec 11, 2017

    @Trott
    Member

    @vic511 Thanks for reporting the bug. As you probably saw, it's now fixed in the latest release.

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

    bufferIssues and PRs related to the buffer subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions