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

fix: node:buffer: Buffer.alloc(size, fill, encoding) throws when fill is a nu... - #8364

Open
Roshan931 wants to merge 1 commit into
cloudflare:mainfrom
Roshan931:prilog/fix-error-buffer-alloc-passes-encoding-in-fill-s-11-11-2026-102ce9
Open

Roshan931 wants to merge 1 commit into
cloudflare:mainfrom
Roshan931:prilog/fix-error-buffer-alloc-passes-encoding-in-fill-s-11-11-2026-102ce9

Conversation

@Roshan931

@Roshan931 Roshan931 commented Nov 11, 2026 •

Copy link
Copy Markdown

Fixes #8286

Root cause

Buffer.alloc passes encoding in fill()'s start slot

Changes

  • alloc() now calls buffer.fill(fill, 0, buffer.length, encoding) so the encoding lands in fill()'s encoding parameter instead of its start parameter; fill() continues to apply the encoding only for string fills and to ignore it otherwise. Added regression assertions covering number, zero, Buffer and string fills with an encoding.

This issue was fixed with Prilog. This is our way of giving back to the open source community.

Signed-off-by: Robert Markovski <5818108+Roshan931@users.noreply.github.com>
@Roshan931
Roshan931 requested review from a team as code owners November 11, 2026 11:24
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@clanky-the-clanker

Copy link
Copy Markdown

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

@Roshan931

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:buffer: Buffer.alloc(size, fill, encoding) throws when fill is a number or a Buffer

2 participants