GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ffi: reject detached ArrayBuffers as pointers by trivikr · Pull Request #65083 · nodejs/node

Conversation

@trivikr

@trivikr trivikr commented Aug 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes: #65082

Reject detached ArrayBuffers and ArrayBuffer views in getRawPointer() and all FFI pointer argument conversion paths, including optimized fast calls. This prevents detached backing stores from being silently passed to native functions as null pointers.


Assisted-by: codex:gpt-5.6-sol

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 6, 2026
@trivikr trivikr added ffi Issues and PRs related to experimental Foreign Function Interface support. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Aug 6, 2026
@trivikr trivikr mentioned this pull request Aug 6, 2026
ffi: clarify detached ArrayBuffer error #65084
Closed
@trivikr
trivikr force-pushed the ffi-detached-arraybuffers-null branch 2 times, most recently from 3713f90 to 6aa48c5 Compare August 7, 2026 02:58
@codecov

codecov Bot commented Aug 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.97183% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.30%. Comparing base (a576f1c) to head (99ac691).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/ffi/fast.cc 0.00% 20 Missing ⚠️
lib/internal/ffi/fast-api.js 75.86% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65083      +/-   ##
==========================================
- Coverage   90.30%   90.30%   -0.01%     
==========================================
  Files         760      760              
  Lines      248526   248595      +69     
  Branches    46886    46911      +25     
==========================================
+ Hits       224439   224496      +57     
- Misses      15515    15528      +13     
+ Partials     8572     8571       -1     
Files with missing lines Coverage Δ
src/ffi/data.cc 75.16% <100.00%> (+1.17%) ⬆️
src/ffi/types.cc 54.20% <100.00%> (+0.82%) ⬆️
lib/internal/ffi/fast-api.js 93.60% <75.86%> (-1.18%) ⬇️
src/ffi/fast.cc 64.12% <0.00%> (-5.64%) ⬇️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MILLERMARRU

This comment was marked as low quality.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 10, 2026
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@trivikr
trivikr marked this pull request as draft August 11, 2026 05:17
@trivikr

This comment was marked as outdated.

Sign in to view
trivikr added 5 commits August 10, 2026 22:17
@trivikr
ffi: reject detached ArrayBuffers as pointers
6a3a7c5
Reject detached ArrayBuffers and ArrayBuffer views in getRawPointer()
and FFI pointer argument conversion. This prevents detached backing
stores from being silently passed to native functions as null pointers.

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: codex:gpt-5.6-sol
@trivikr
fixup! ffi: clarify detached ArrayBuffer error
9a8f5b8
Report that the ArrayBuffer is detached instead of describing its
backing store as invalid.

Signed-off-by: Kamat, Trivikram <[email protected]>
@trivikr
fixup! test: use arrayBuffer.transfer()
624321d
@trivikr
fixup! ffi: reject detached ArrayBuffers as pointers
9e72257
@trivikr
amend! ffi: reject detached ArrayBuffers as pointers
99ac691
ffi: reject detached ArrayBuffers as pointers

Reject detached ArrayBuffers and ArrayBuffer views in getRawPointer()
and all FFI pointer argument conversion paths, including optimized
fast calls. This prevents detached backing stores from being silently
passed to native functions as null pointers.

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: codex:gpt-5.6-sol
@trivikr
trivikr force-pushed the ffi-detached-arraybuffers-null branch from 6aa48c5 to 99ac691 Compare August 11, 2026 05:32
@trivikr
trivikr marked this pull request as ready for review August 11, 2026 05:33
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/75778/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr
trivikr requested a review from ShogunPanda August 11, 2026 15:26
ShogunPanda
ShogunPanda approved these changes Aug 12, 2026
View reviewed changes
@trivikr trivikr added commit-queue-squash PRs the Commit Queue should land as one squashed commit. commit-queue PRs queued for automated landing through the Commit Queue. labels Aug 12, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 525e8f4 into nodejs:main Aug 13, 2026
92 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Landed in 525e8f4

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 13, 2026
@trivikr
trivikr deleted the ffi-detached-arraybuffers-null branch August 16, 2026 16:01
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
@trivikr @aduh95
ffi: reject detached ArrayBuffers as pointers
01e7883
Reject detached ArrayBuffers and ArrayBuffer views in getRawPointer()
and FFI pointer argument conversion. This prevents detached backing
stores from being silently passed to native functions as null pointers.

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #65083
Fixes: #65082
Reviewed-By: Paolo Insogna <[email protected]>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
@trivikr @aduh95
ffi: reject detached ArrayBuffers as pointers
be2ab89
Reject detached ArrayBuffers and ArrayBuffer views in getRawPointer()
and FFI pointer argument conversion. This prevents detached backing
stores from being silently passed to native functions as null pointers.

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #65083
Fixes: #65082
Reviewed-By: Paolo Insogna <[email protected]>
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
2026-08-26, Version 26.8.0 (Current) #65551
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ShogunPanda ShogunPanda ShogunPanda approved these changes
+1 more reviewer
@MILLERMARRU MILLERMARRU MILLERMARRU left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ffi: Detached ArrayBuffers and views are silently converted to null FFI pointers

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@trivikr @nodejs-github-bot @ShogunPanda @MILLERMARRU
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.