René's URL Explorer Experiment


Title: buffer: throw on write() to immutable buffers by vedchaudhari · Pull Request #67741 · nodejs/node · GitHub

Open Graph Title: buffer: throw on write() to immutable buffers by vedchaudhari · Pull Request #67741 · nodejs/node

X Title: buffer: throw on write() to immutable buffers by vedchaudhari · Pull Request #67741 · nodejs/node

Description: buf.write() and the encoding-specific write methods (utf8Write(), hexWrite(), etc.) write into buffers backed by an immutable ArrayBuffer: // node --js-immutable-arraybuffer const buf = Buffer.from(new Uint8Array([1, 2, 3, 4]).buffer.transferToImmutable()); buf.write('hi'); console.log(buf); // buf.fill(), buf.set() and the writeUInt*() methods already throw here. This adds the check to the three native write paths, including the fast API one, and throws ERR_INVALID_ARG_VALUE like crypto.randomFillSync() does (#66944). Invalid arguments are still reported first, and zero-byte writes throw too, like TypedArray methods. SPREAD_BUFFER_ARG now keeps the ArrayBuffer it already fetches, so the check doesn't need a second Buffer() call. With that, the buffers/buffer-write-string* benchmarks are about -1% on average, and at most about -3.5% for 1-32 byte writes. Refs: #66346 Assisted-by: an AI coding agent. Reviewed and tested locally by me. cc @jasnell @panva

Open Graph Description: buf.write() and the encoding-specific write methods (utf8Write(), hexWrite(), etc.) write into buffers backed by an immutable ArrayBuffer: // node --js-immutable-arraybuffer const buf = Buffer.from...

X Description: buf.write() and the encoding-specific write methods (utf8Write(), hexWrite(), etc.) write into buffers backed by an immutable ArrayBuffer: // node --js-immutable-arraybuffer const buf = Buffer.from...

Opengraph URL: https://github.com/nodejs/node/pull/67741

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6cb6114c-bf70-788b-0450-0817e4c500a0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDB32:3C042B:31D179:41581A:6B061742
html-safe-nonce2d09eea5923041a219e318a54e8ceab6a87e669db2cbd8048a214f1cd327c217
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjMyOjNDMDQyQjozMUQxNzk6NDE1ODFBOjZCMDYxNzQyIiwidmlzaXRvcl9pZCI6IjQxNjU4MDAwOTA1NTg0MDQ0MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3fd7682344a894aca5690c48e32de3fbe26e61ad148cc7f2c26ab2721fafa350
hovercard-subject-tagpull_request:5467240134
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/67741/files
twitter:imagehttps://avatars.githubusercontent.com/u/84765263?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/84765263?s=400&v=4
og:image:altbuf.write() and the encoding-specific write methods (utf8Write(), hexWrite(), etc.) write into buffers backed by an immutable ArrayBuffer: // node --js-immutable-arraybuffer const buf = Buffer.from...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release866f202ebf7ac5aff8f633417d9fd8a53818a977
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/67741/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F67741%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F67741%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/67741/files
Reloadhttps://github.com/nodejs/node/pull/67741/files
Reloadhttps://github.com/nodejs/node/pull/67741/files
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues630 (630)https://github.com/nodejs/node/issues
Pull requests660 (660)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
vedchaudharihttps://github.com/vedchaudhari
nodejs:mainhttps://github.com/nodejs/node/tree/main
vedchaudhari:buffer-write-immutablehttps://github.com/vedchaudhari/node/tree/buffer-write-immutable
Conversation 2 https://github.com/nodejs/node/pull/67741
Commits 1 https://github.com/nodejs/node/pull/67741/commits
Checks 45 https://github.com/nodejs/node/pull/67741/checks
Files changed 3 https://github.com/nodejs/node/pull/67741/files
buffer: throw on write() to immutable buffers https://github.com/nodejs/node/pull/67741/files#top
Show all changes 1 commit https://github.com/nodejs/node/pull/67741/files
2053ed6 buffer: throw on write() to immutable buffers vedchaudhari Nov 24, 2026 https://github.com/nodejs/node/pull/67741/commits/2053ed6098ba0df3901139382e92efa8ab816559
Clear filters https://github.com/nodejs/node/pull/67741/files
Please reload this pagehttps://github.com/nodejs/node/pull/67741/files
Please reload this pagehttps://github.com/nodejs/node/pull/67741/files
node_buffer.cc https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
util.h https://github.com/nodejs/node/pull/67741/files#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
test-buffer-write-immutable.js https://github.com/nodejs/node/pull/67741/files#diff-c131f0676f4ab468f0d21a41138cd6ad8c9e08df0d6045a1f3c3d8e029f1ace3
src/node_buffer.cchttps://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
View file https://github.com/nodejs/node/blob/2053ed6098ba0df3901139382e92efa8ab816559/src/node_buffer.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/67741/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/67741/files#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
src/util.hhttps://github.com/nodejs/node/pull/67741/files#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
View file https://github.com/nodejs/node/blob/2053ed6098ba0df3901139382e92efa8ab816559/src/util.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/67741/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/67741/files#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
https://github.com/nodejs/node/pull/67741/files#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
test/parallel/test-buffer-write-immutable.jshttps://github.com/nodejs/node/pull/67741/files#diff-c131f0676f4ab468f0d21a41138cd6ad8c9e08df0d6045a1f3c3d8e029f1ace3
View file https://github.com/nodejs/node/blob/2053ed6098ba0df3901139382e92efa8ab816559/test/parallel/test-buffer-write-immutable.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/67741/{{ revealButtonHref }}
Please reload this pagehttps://github.com/nodejs/node/pull/67741/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.