Skip to content

Exit MatchDomainName if pattern or string length reach 0.#10119

Merged
douzzer merged 2 commits intowolfSSL:masterfrom
kareem-wolfssl:zd21512
Apr 3, 2026
Merged

Exit MatchDomainName if pattern or string length reach 0.#10119
douzzer merged 2 commits intowolfSSL:masterfrom
kareem-wolfssl:zd21512

Conversation

@kareem-wolfssl
Copy link
Copy Markdown
Contributor

@kareem-wolfssl kareem-wolfssl commented Apr 1, 2026

Description

Fixes zd#21512.
Thanks to Zou Dikai for the report!

Testing

Tested using provided reproducer.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 18:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses zd#21512 by updating the hostname/pattern matching loop in MatchDomainName() to stop processing when either the pattern or input string length reaches zero, aiming to prevent out-of-bounds reads during hostname verification.

Changes:

  • Update MatchDomainName() main loop condition to also require strLen > 0 before continuing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kareem-wolfssl
Copy link
Copy Markdown
Contributor Author

Retest this please

Copilot AI review requested due to automatic review settings April 2, 2026 18:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/internal.c:1

  • The PR title says "Exit MatchDomainName if pattern or string length reach 0.", but this change only adds a guard for strLen == 0. Either update the PR title/description to reflect the actual scope, or add the corresponding patternLen guard at the point(s) where pattern is dereferenced to fully match the stated intent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kareem-wolfssl kareem-wolfssl added the For This Release Release version 5.9.1 label Apr 2, 2026
@douzzer douzzer added the Staged Staged for merge pending final test results and review label Apr 2, 2026
@douzzer douzzer merged commit ed1f055 into wolfSSL:master Apr 3, 2026
496 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.1 Staged Staged for merge pending final test results and review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants