Skip to content

Fix wherelen handling in BIO_ADDR_rawmake AF_UNIX path#3233

Merged
samuel40791765 merged 1 commit into
aws:mainfrom
samuel40791765:bio-addr-unix-fix
May 11, 2026
Merged

Fix wherelen handling in BIO_ADDR_rawmake AF_UNIX path#3233
samuel40791765 merged 1 commit into
aws:mainfrom
samuel40791765:bio-addr-unix-fix

Conversation

@samuel40791765
Copy link
Copy Markdown
Contributor

Issues:

Addresses V2196133741

Description of changes:

Two issues in the AF_UNIX branch of BIO_ADDR_rawmake:

  1. wherelen + 1 > sizeof(...) wraps to 0 when wherelen == SIZE_MAX, bypassing the bound check. Rewritten as wherelen >= sizeof(...).
  2. OPENSSL_strlcpy(dst, src, wherelen) treats its third argument as the destination buffer size, not the number of source bytes, so only wherelen - 1 bytes were copied and src was required to be NUL-terminated even though the comment above states it isn't. Replaced with OPENSSL_memcpy; the preceding OPENSSL_cleanse of ap->s_un already leaves a trailing NUL.

Call-outs:

None.

Testing:

Existing bio_socket_test cases continue to pass.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.29%. Comparing base (9651480) to head (f13b21f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3233      +/-   ##
==========================================
+ Coverage   78.12%   78.29%   +0.17%     
==========================================
  Files         689      689              
  Lines      123214   123217       +3     
  Branches    17137    17141       +4     
==========================================
+ Hits        96257    96476     +219     
+ Misses      26047    25829     -218     
- Partials      910      912       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samuel40791765 samuel40791765 enabled auto-merge (squash) May 11, 2026 19:49
@samuel40791765 samuel40791765 merged commit f8d3b92 into aws:main May 11, 2026
487 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants