Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential out-of-bounds access in strncmp()
The current strncmp() implementation may continue comparing strings when they are identical and shorter than 'len', leading to potential out-of-bounds memory access. For example, strncmp("abc", "abc", 5) could access memory beyond the end of the strings. Add a check to return 0 if the end of either string is reached before 'len', preventing unintended memory access.
- Loading branch information