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

src: fix out-of-bounds write when transcoding odd-length ucs2 by Nashit-h · Pull Request #64512 · nodejs/node · GitHub

/ node Public

src: fix out-of-bounds write when transcoding odd-length ucs2 - #64512

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Nashit-h:ucs2-transcode-overflow
Aug 22, 2026
Merged

src: fix out-of-bounds write when transcoding odd-length ucs2#64512
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Nashit-h:ucs2-transcode-overflow

Conversation

Copy link
Copy Markdown
Contributor

CopySourceBuffer sizes its destination for whole UChar units (source_length / sizeof(UChar)) but memcpy's the raw byte length, so Buffer.transcode() of an odd-length utf16le buffer into latin1/ascii writes one byte past the conversion buffer, on both the on-stack and the heap path. Copy only the whole code units so a trailing half byte is ignored; ucnv_fromUChars already consumes length_in_chars units, so the extra byte was never read back. Added an odd-length case to test-icu-transcode.js that trips ASAN on the current code.

Signed-off-by: Nashit-h <nashit@bugqore.com>
nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. i18n-api Issues and PRs related to the i18n implementation. needs-ci PRs that need a full CI run. labels Jul 15, 2026

codecov Bot commented Jul 15, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.23%. Comparing base (7a11a9b) to head (b13f21c).
⚠️ Report is 559 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64512      +/-   ##
==========================================
- Coverage   90.24%   90.23%   -0.02%     
==========================================
  Files         739      739              
  Lines      241669   241654      -15     
  Branches    45543    45552       +9     
==========================================
- Hits       218087   218049      -38     
+ Misses      15150    15134      -16     
- Partials     8432     8471      +39     
Files with missing lines Coverage Δ
src/node_i18n.cc 78.27% <100.00%> (+6.48%) ⬆️

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

Renegade334 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 23, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 23, 2026

This comment was marked as duplicate.

Copy link
Copy Markdown
Contributor Author

This is approved and green everywhere except the shared-libs Jenkins node, which failed on its own while every sibling job (linked-icu, smallicu, withoutintl, openssl, zlib) passed, so it looks like a flaky run rather than anything from this change. Could someone start a fresh CI so it can land?

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

trivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 22, 2026
nodejs-github-bot merged commit 70c189b into nodejs:main Aug 22, 2026
87 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 70c189b

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 22, 2026
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Signed-off-by: Nashit-h <nashit@bugqore.com>
PR-URL: #64512
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Signed-off-by: Nashit-h <nashit@bugqore.com>
PR-URL: #64512
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
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

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. i18n-api Issues and PRs related to the i18n implementation. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL