Fix strncasecmp bounds and alpha-only case folding#691
Fix strncasecmp bounds and alpha-only case folding#691danielinux wants to merge 3 commits intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
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.cwith tests coveringstr(n)casecmp, ctype helpers, memory/string routines, and UART formatting helpers. - Updated unit-test Makefile to build/run the new
unit-stringtarget. - Updated
src/string.cto restrict case-insensitive matching to alphabetic characters and to fix thestrncasecmpnbound 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
17db934 to
2244688
Compare
+ Added unit tests for string.c
- Converted 'strncat' to the standard POSIX behavior. Fixed fdt-parser to use the right len argument.
Ref: fenrir M-4 and L-3