Skip to content

Comments

Fix strncasecmp bounds and alpha-only case folding#691

Open
danielinux wants to merge 3 commits intowolfSSL:masterfrom
danielinux:fix_strings_c
Open

Fix strncasecmp bounds and alpha-only case folding#691
danielinux wants to merge 3 commits intowolfSSL:masterfrom
danielinux:fix_strings_c

Conversation

@danielinux
Copy link
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
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.

Copy link
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.

Copy link
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.

- Converted 'strncat' to the standard POSIX behavior. Fixed fdt-parser
  to use the right len argument.
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.

1 participant