Skip to content

fs: validate position argument before length === 0 early return#62674

Open
geeksilva97 wants to merge 1 commit intonodejs:mainfrom
geeksilva97:fix-fs-read-sync
Open

fs: validate position argument before length === 0 early return#62674
geeksilva97 wants to merge 1 commit intonodejs:mainfrom
geeksilva97:fix-fs-read-sync

Conversation

@geeksilva97
Copy link
Copy Markdown
Contributor

@geeksilva97 geeksilva97 commented Apr 10, 2026

Move position validation upwards to match documented behavior.

Fixes #62638

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Apr 10, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.76%. Comparing base (68d7b6f) to head (de1c243).
⚠️ Report is 517 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62674      +/-   ##
==========================================
- Coverage   89.77%   89.76%   -0.02%     
==========================================
  Files         673      697      +24     
  Lines      203820   215153   +11333     
  Branches    39175    41184    +2009     
==========================================
+ Hits       182987   193136   +10149     
- Misses      13152    14202    +1050     
- Partials     7681     7815     +134     
Files with missing lines Coverage Δ
lib/fs.js 98.19% <100.00%> (+<0.01%) ⬆️
lib/internal/fs/promises.js 92.94% <100.00%> (-5.79%) ⬇️

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

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.readSync does not validate invalid position type (accepts object instead of throwing)

2 participants