FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ffi: reject detached ArrayBuffers as pointers by trivikr · Pull Request #65083 · nodejs/node · GitHub

/ node Public

ffi: reject detached ArrayBuffers as pointers - #65083

Merged
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
trivikr:ffi-detached-arraybuffers-null
Aug 13, 2026
Merged

ffi: reject detached ArrayBuffers as pointers#65083
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
trivikr:ffi-detached-arraybuffers-null

Conversation

trivikr commented Aug 6, 2026
edited
Loading

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

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

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 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. labels Aug 6, 2026
trivikr force-pushed the ffi-detached-arraybuffers-null branch 2 times, most recently from 3713f90 to 6aa48c5 Compare August 7, 2026 02:58

codecov Bot commented Aug 7, 2026
edited
Loading

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.

This comment was marked as low quality.

trivikr removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 10, 2026

This comment was marked as outdated.

This comment was marked as outdated.

trivikr marked this pull request as draft August 11, 2026 05:17

This comment was marked as outdated.

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 <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
Report that the ArrayBuffer is detached instead of describing its
backing store as invalid.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
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 <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
trivikr force-pushed the ffi-detached-arraybuffers-null branch from 6aa48c5 to 99ac691 Compare August 11, 2026 05:32
trivikr marked this pull request as ready for review August 11, 2026 05:33

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

trivikr requested a review from ShogunPanda August 11, 2026 15:26
trivikr added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 12, 2026
nodejs-github-bot merged commit 525e8f4 into nodejs:main Aug 13, 2026
92 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 525e8f4

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 13, 2026
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
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 <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #65083
Fixes: #65082
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
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 <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #65083
Fixes: #65082
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants


Back | FazBrowse Home | New Git URL