Skip to content

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

Open
kareem-wolfssl wants to merge 2 commits intowolfSSL:masterfrom
kareem-wolfssl:zd21512
Open

Exit MatchDomainName if pattern or string length reach 0.#10119
kareem-wolfssl wants to merge 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

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.

2 participants