René's URL Explorer Experiment


Title: Buffer#indexOf()/lastIndexOf()/includes() abort the process when end is not a number · Issue #66589 · nodejs/node · GitHub

Open Graph Title: Buffer#indexOf()/lastIndexOf()/includes() abort the process when end is not a number · Issue #66589 · nodejs/node

X Title: Buffer#indexOf()/lastIndexOf()/includes() abort the process when end is not a number · Issue #66589 · nodejs/node

Description: Version v27.0.0-nightly20261007aa1bf2cc37 (main at 9899b39) Platform Linux x64 Subsystem buffer What steps will reproduce the bug? const buf = Buffer.from('abcabc'); // Each of these aborts the process, try/catch does not help: buf.index...

Open Graph Description: Version v27.0.0-nightly20261007aa1bf2cc37 (main at 9899b39) Platform Linux x64 Subsystem buffer What steps will reproduce the bug? const buf = Buffer.from('abcabc'); // Each of these aborts the pro...

X Description: Version v27.0.0-nightly20261007aa1bf2cc37 (main at 9899b39) Platform Linux x64 Subsystem buffer What steps will reproduce the bug? const buf = Buffer.from('abcabc'); // Each of these aborts...

Opengraph URL: https://github.com/nodejs/node/issues/66589

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Buffer#indexOf()/lastIndexOf()/includes() abort the process when end is not a number","articleBody":"### Version\n\nv27.0.0-nightly20261007aa1bf2cc37 (main at 9899b39b95)\n\n### Platform\n\nLinux x64\n\n### Subsystem\n\nbuffer\n\n### What steps will reproduce the bug?\n\n```js\nconst buf = Buffer.from('abcabc');\n\n// Each of these aborts the process, try/catch does not help:\nbuf.indexOf('a', 0, null);\nbuf.includes(97, 0, null);\nbuf.lastIndexOf(Buffer.from('a'), 5, {});\n\n// These return -1, expected 0:\nbuf.indexOf('a', 0, Infinity);\nbuf.indexOf(97, 0, 1e20);\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways. Any `end` other than a number, a string or `undefined` aborts (`null`, booleans, objects, arrays, BigInts, symbols). Numbers outside the int64 range give a wrong result on x64.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`end` is documented as `{integer}`, so a wrong type should throw `ERR_INVALID_ARG_TYPE` instead of aborting. `Infinity` should be clamped to `buf.length`, the same way `end = 100` already is.\n\n### What do you see instead?\n\n```\n  #  node[788155]: void node::Buffer::(anonymous namespace)::IndexOfString(const FunctionCallbackInfo\u003cValue> &) at ../src/node_buffer.cc:1036\n  #  Assertion failed: args[5]->IsNumber()\n```\n\nand `-1` for the `Infinity` / `1e20` cases.\n\n### Additional information\n\nThe three methods only handle `end` in JS when it is a string (treated as the encoding) or `undefined`; anything else goes straight to the binding. `IndexOfString` and `IndexOfBuffer` do `CHECK(args[5]->IsNumber())` and `SlowIndexOfNumber` does `CHECK(args[4]->IsNumber())`. Numbers are read with `As\u003cInteger>()->Value()`, which for NaN, ±Infinity or values beyond int64 is an undefined double-to-int64 conversion (`INT64_MIN` on x64, which is then clamped to 0).\n\n`end` was added in #62390. I have a fix and will open a PR.\n","author":{"url":"https://github.com/gengjiawen","@type":"Person","name":"gengjiawen"},"datePublished":"2026-10-08T06:33:06Z","url":"https://github.com/nodejs/node/issues/66589"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b20efb95-2ac2-31d2-2254-8b832249862c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA3B4:39A2F9:93FB8B:C55C54:6AED2EE1
html-safe-nonceb0dbc4dcd042920149217a7ae1759c4717b07cf68f9b95375cde6dd720d11cb4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0I0OjM5QTJGOTo5M0ZCOEI6QzU1QzU0OjZBRUQyRUUxIiwidmlzaXRvcl9pZCI6IjY4MzYyMTk4MzUzMjMzMzAyNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac96b522ff22e0756be3a343b15ec4eb0100c92186f0c1e66dcc8a00c220f78842
hovercard-subject-tagissue:5757109302
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66589/issue_layout
twitter:imagehttps://opengraph.githubassets.com/56111af50fad57ada8e363c0b309088b9bbc0e28552c549798de8b52560d6b94/nodejs/node/issues/66589
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/56111af50fad57ada8e363c0b309088b9bbc0e28552c549798de8b52560d6b94/nodejs/node/issues/66589
og:image:altVersion v27.0.0-nightly20261007aa1bf2cc37 (main at 9899b39) Platform Linux x64 Subsystem buffer What steps will reproduce the bug? const buf = Buffer.from('abcabc'); // Each of these aborts the pro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegengjiawen
hostnamegithub.com
expected-hostnamegithub.com
Nonee51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release59ebb7b901cc154ecc179a44f266fcf69f343b30
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/66589#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66589
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%2Fissues%2F66589
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/66589
Reloadhttps://github.com/nodejs/node/issues/66589
Reloadhttps://github.com/nodejs/node/issues/66589
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests666 (666)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/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66589
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66589
#66590https://github.com/nodejs/node/pull/66590
Buffer#indexOf()/lastIndexOf()/includes() abort the process when end is not a numberhttps://github.com/nodejs/node/issues/66589#top
#66590https://github.com/nodejs/node/pull/66590
https://github.com/gengjiawen
gengjiawenhttps://github.com/gengjiawen
on Oct 8, 2026https://github.com/nodejs/node/issues/66589#issue-5757109302
9899b39https://github.com/nodejs/node/commit/9899b39b95e2ca623ac39e6f164c00f4bcefaf2d
#62390https://github.com/nodejs/node/pull/62390
gengjiawenhttps://github.com/gengjiawen
on Oct 8, 2026https://github.com/nodejs/node/issues/66589#event-32755959434
buffer: validate end argument of indexOf methodshttps://github.com/gengjiawen/node/commit/8a5c8ae34cb9780bda9c7a21613c005a3ee4c44b
8a5c8aehttps://github.com/gengjiawen/node/commit/8a5c8ae34cb9780bda9c7a21613c005a3ee4c44b
https://github.com/Yusuf-Hussien
Yusuf-Hussienhttps://github.com/Yusuf-Hussien
on Oct 8, 2026https://github.com/nodejs/node/issues/66589#issuecomment-6059657471
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/66589
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66589
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

Viewport: width=device-width


URLs of crawlers that visited me.