Skip to content

zlib: validate pledgedSrcSize for sync zstd - #64601

Closed
Archkon wants to merge 1 commit into
nodejs:mainfrom
Archkon:zlib2
Closed

zlib: validate pledgedSrcSize for sync zstd#64601
Archkon wants to merge 1 commit into
nodejs:mainfrom
Archkon:zlib2

Conversation

@Archkon

@Archkon Archkon commented Jul 19, 2026

Copy link
Copy Markdown

Fixes: #64600

@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. zlib Issues and PRs related to the zlib subsystem. labels Jul 19, 2026
@Archkon

This comment was marked as spam.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (4a5eb1c) to head (a23d7a9).
⚠️ Report is 202 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64601      +/-   ##
==========================================
- Coverage   90.15%   90.12%   -0.03%     
==========================================
  Files         744      744              
  Lines      242517   242534      +17     
  Branches    45688    45698      +10     
==========================================
- Hits       218642   218589      -53     
- Misses      15358    15437      +79     
+ Partials     8517     8508       -9     
Files with missing lines Coverage Δ
src/node_zlib.cc 79.15% <100.00%> (-0.05%) ⬇️

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

@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 20, 2026
@nodejs-github-bot

This comment has been minimized.

@Archkon

This comment was marked as spam.

Zstd replaces a configured pledged source size with the input size when
the first call to ZSTD_compressStream2() uses ZSTD_e_end. Track consumed
input in Node and report ZSTD_error_srcSize_wrong when the completed
frame does not match the original pledge.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
@Archkon

This comment was marked as spam.

@Archkon

This comment was marked as spam.

@nodejs-github-bot

This comment has been minimized.

@Archkon

This comment was marked as spam.

@Renegade334

Copy link
Copy Markdown
Member

You killed the runner apparently 😉

07:29:41 Agent went offline during the build

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkeller avivkeller added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 5, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 5, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64601
✔  Done loading data for nodejs/node/pull/64601
----------------------------------- PR info ------------------------------------
Title      zlib: validate pledgedSrcSize for sync zstd (#64601)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     Archkon:zlib2 -> nodejs:main
Labels     c++, zlib, author ready, needs-ci
Commits    1
 - zlib: validate pledgedSrcSize for sync zstd
Committers 1
 - Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64601
Fixes: https://github.com/nodejs/node/issues/64600
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64601
Fixes: https://github.com/nodejs/node/issues/64600
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
[TypeError: Cannot read properties of null (reading 'oid')]
https://github.com/nodejs/node/actions/runs/30968647815

@Archkon

This comment was marked as spam.

@Archkon

This comment was marked as spam.

@avivkeller

Copy link
Copy Markdown
Member

I'm not sure that's the issue, cc @nodejs/node-core-utils

@avivkeller

Copy link
Copy Markdown
Member

Maybe it was, however, the error message should be clearer, IMO

@avivkeller avivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 7, 2026
@panva panva removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Aug 8, 2026
@Archkon

This comment was marked as spam.

@panva panva added commit-queue Add this label to land a pull request using GitHub Actions. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 8, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64601
✔  Done loading data for nodejs/node/pull/64601
----------------------------------- PR info ------------------------------------
Title      zlib: validate pledgedSrcSize for sync zstd (#64601)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     Archkon:zlib2 -> nodejs:main
Labels     c++, zlib, author ready, needs-ci
Commits    1
 - zlib: validate pledgedSrcSize for sync zstd
Committers 1
 - Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64601
Fixes: https://github.com/nodejs/node/issues/64600
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64601
Fixes: https://github.com/nodejs/node/issues/64600
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 19 Jul 2026 14:30:06 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/64601#pullrequestreview-4731028151
   ✔  - Aviv Keller (@avivkeller): https://github.com/nodejs/node/pull/64601#pullrequestreview-4879565446
   ✘  2 GitHub CI job(s) failed:
   ✘    - aarch64-linux: with shared boringssl-0.20260526.0 / build: FAILURE (https://github.com/nodejs/node/actions/runs/30204628282/job/89800606890)
   ✘    - aarch64-linux: with shared boringssl-0.20260526.0 / build: FAILURE (https://github.com/nodejs/node/actions/runs/30205617244/job/89803411290)
   ✘  13 GitHub CI job(s) cancelled:
   ✘    - test-tarball-linux: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628218/job/89800769656)
   ✘    - coverage-linux: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628224/job/89800445824)
   ✘    - test-linux (ubuntu-24.04-arm): CANCELLED (https://github.com/nodejs/node/actions/runs/30204628225/job/89800445627)
   ✘    - test-linux (ubuntu-24.04): CANCELLED (https://github.com/nodejs/node/actions/runs/30204628225/job/89800445648)
   ✘    - coverage-windows: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628239/job/89800445756)
   ✘    - test-macOS: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628245/job/89800445631)
   ✘    - x86_64-linux: with shared libraries / build: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628282/job/89800571409)
   ✘    - x86_64-darwin: with shared libraries / build: CANCELLED (https://github.com/nodejs/node/actions/runs/30204628282/job/89800571452)
   ✘    - test-macOS: CANCELLED (https://github.com/nodejs/node/actions/runs/30205617143/job/89803043791)
   ✘    - test-linux (ubuntu-24.04-arm): CANCELLED (https://github.com/nodejs/node/actions/runs/30205617152/job/89803501621)
   ✘    - test-linux (ubuntu-24.04): CANCELLED (https://github.com/nodejs/node/actions/runs/30205617152/job/89803501631)
   ✘    - coverage-windows: CANCELLED (https://github.com/nodejs/node/actions/runs/30205617153/job/89803053112)
   ✘    - coverage-linux: CANCELLED (https://github.com/nodejs/node/actions/runs/30205617155/job/89803043995)
   ℹ  Last Full PR CI on 2026-08-04T14:50:42Z: https://ci.nodejs.org/job/node-test-pull-request/75463/
- Querying data for job/node-test-pull-request/75463/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/31256774273

@Archkon

This comment was marked as spam.

avivkeller pushed a commit that referenced this pull request Aug 8, 2026
Zstd replaces a configured pledged source size with the input size when
the first call to ZSTD_compressStream2() uses ZSTD_e_end. Track consumed
input in Node and report ZSTD_error_srcSize_wrong when the completed
frame does not match the original pledge.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: #64601
Fixes: #64600
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
@avivkeller

Copy link
Copy Markdown
Member

Landed in c3de450

@avivkeller avivkeller closed this Aug 8, 2026
aduh95 pushed a commit that referenced this pull request Aug 13, 2026
Zstd replaces a configured pledged source size with the input size when
the first call to ZSTD_compressStream2() uses ZSTD_e_end. Track consumed
input in Node and report ZSTD_error_srcSize_wrong when the completed
frame does not match the original pledge.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: #64601
Fixes: #64600
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zlib: zstdCompressSync() does not validate pledgedSrcSize

7 participants