Skip to content

buffer: prevent string write offset overflow - #65043

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:harden-slow-write-string-bounds
Open

buffer: prevent string write offset overflow#65043
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:harden-slow-write-string-bounds

Conversation

@mcollina

@mcollina mcollina commented Aug 5, 2026

Copy link
Copy Markdown
Member

Reject offsets outside the destination buffer before subtracting from its length in SlowWriteString. Normalize wrapper arguments once so validated values reach the native binding.

Reject offsets outside the destination buffer before subtracting from
its length in SlowWriteString. Normalize wrapper arguments once so
validated values reach the native binding.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. 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 5, 2026
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.30%. Comparing base (f43086d) to head (f6f61c3).
⚠️ Report is 64 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/buffer.js 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65043      +/-   ##
==========================================
+ Coverage   90.27%   90.30%   +0.02%     
==========================================
  Files         762      759       -3     
  Lines      247515   247609      +94     
  Branches    46683    46683              
==========================================
+ Hits       223447   223603     +156     
+ Misses      15485    15460      -25     
+ Partials     8583     8546      -37     
Files with missing lines Coverage Δ
src/node_buffer.cc 69.25% <ø> (-0.16%) ⬇️
lib/internal/buffer.js 98.93% <91.66%> (+0.18%) ⬆️

... and 60 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants