Skip to content

fix: RangeError [ERR_BUFFER_OUT_OF_BOUNDS] "length" is outside of buffer bounds#2026

Closed
waitingsong wants to merge 1 commit into
protobufjs:masterfrom
waitingsong:write-string-buffer
Closed

fix: RangeError [ERR_BUFFER_OUT_OF_BOUNDS] "length" is outside of buffer bounds#2026
waitingsong wants to merge 1 commit into
protobufjs:masterfrom
waitingsong:write-string-buffer

Conversation

@waitingsong
Copy link
Copy Markdown

@waitingsong waitingsong commented Aug 25, 2024

fix: RangeError [ERR_BUFFER_OUT_OF_BOUNDS] "length" is outside of buffer bounds since nodejs 22.7

call buf.utf8Write() conditionally, it will be called in buf.write()

ref: #2025

@waitingsong
Copy link
Copy Markdown
Author

2024-08-26_001136

@waitingsong waitingsong force-pushed the write-string-buffer branch 2 times, most recently from e3ad74e to 94be511 Compare August 25, 2024 16:52
…fer bounds since nodejs 22.7

call buf.utf8Write() conditionally,  it will be called in buf.write()

ref: protobufjs#2025
basti1302 added a commit to dash0hq/opentelemetry-js-distribution that referenced this pull request Aug 28, 2024
basti1302 added a commit to dash0hq/opentelemetry-js-distribution that referenced this pull request Aug 28, 2024
@oskrim
Copy link
Copy Markdown

oskrim commented Sep 1, 2025

What is preventing this from getting merged? This bug prevents using the library on Node.js 24.x.x

@dcodeIO
Copy link
Copy Markdown
Member

dcodeIO commented May 8, 2026

Does not reproduce for me on Node.js 24.x. As far as I can tell, this was a Node.js Buffer regression rather than a protobuf.js bug, and it appears to have been fixed upstream in nodejs/node#54524.

@dcodeIO dcodeIO closed this May 8, 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.

3 participants