Skip to content

crypto: add null checks for OPENSSL_INIT_new()#63457

Open
ndossche wants to merge 1 commit into
nodejs:mainfrom
ndossche:clesss-7
Open

crypto: add null checks for OPENSSL_INIT_new()#63457
ndossche wants to merge 1 commit into
nodejs:mainfrom
ndossche:clesss-7

Conversation

@ndossche
Copy link
Copy Markdown
Contributor

Other calls in initialization code often already check for null pointers via CHECK_NOT_NULL(). Do the same here.

This was found with the help of a static-dynamic analyzer I'm working on.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels May 20, 2026
Other calls in initialization code often already check for null pointers
via CHECK_NOT_NULL(). Do the same here.

Signed-off-by: ndossche <7771979+ndossche@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (0e8fb91) to head (f5100f8).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_util.cc 0.00% 0 Missing and 1 partial ⚠️
src/node.cc 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63457      +/-   ##
==========================================
- Coverage   90.06%   90.04%   -0.03%     
==========================================
  Files         714      714              
  Lines      225918   225920       +2     
  Branches    42735    42733       -2     
==========================================
- Hits       203471   203421      -50     
- Misses      14232    14277      +45     
- Partials     8215     8222       +7     
Files with missing lines Coverage Δ
src/crypto/crypto_util.cc 73.18% <0.00%> (-0.42%) ⬇️
src/node.cc 76.06% <0.00%> (-0.10%) ⬇️

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants