Skip to content

Fix strncasecmp bounds and alpha-only case folding#691

Merged
dgarske merged 3 commits intowolfSSL:masterfrom
danielinux:fix_strings_c
Feb 23, 2026
Merged

Fix strncasecmp bounds and alpha-only case folding#691
dgarske merged 3 commits intowolfSSL:masterfrom
danielinux:fix_strings_c

Conversation

@danielinux
Copy link
Copy Markdown
Member

  • Added unit tests for string.c

Ref: fenrir M-4 and L-3

Copilot AI review requested due to automatic review settings February 23, 2026 17:21
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

Adds a new unit-test target for string.c and adjusts strcasecmp/strncasecmp to avoid non-alphabetic “case folding” while also fixing the strncasecmp iteration bound.

Changes:

  • Added unit-string.c with tests covering str(n)casecmp, ctype helpers, memory/string routines, and UART formatting helpers.
  • Updated unit-test Makefile to build/run the new unit-string target.
  • Updated src/string.c to restrict case-insensitive matching to alphabetic characters and to fix the strncasecmp n bound check.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
tools/unit-tests/unit-string.c Introduces new unit tests for string.c behaviors (including UART formatting helpers).
tools/unit-tests/Makefile Adds unit-string to the unit-test build and defines how it’s compiled.
src/string.c Updates strcasecmp/strncasecmp case folding logic and tightens the n stopping condition.

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

Comment thread src/string.c Outdated
Comment thread src/string.c Outdated
Comment thread src/string.c Outdated
Comment thread tools/unit-tests/unit-string.c
Comment thread tools/unit-tests/unit-string.c Outdated
Comment thread tools/unit-tests/unit-string.c Outdated
Comment thread tools/unit-tests/unit-string.c Outdated
Comment thread tools/unit-tests/unit-string.c
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 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread tools/unit-tests/unit-string.c Outdated
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 4 out of 4 changed files in this pull request and generated 2 comments.


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

Comment thread src/string.c
Comment thread src/string.c
- Converted 'strncat' to the standard POSIX behavior. Fixed fdt-parser
  to use the right len argument.
@danielinux danielinux assigned dgarske and unassigned danielinux Feb 23, 2026
@danielinux danielinux requested a review from dgarske February 23, 2026 20:47
@dgarske dgarske merged commit 9eca74d into wolfSSL:master Feb 23, 2026
418 of 420 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.

3 participants