[all-commits] [llvm/llvm-project] a85dcb: [libc] fix oob and overflow bugs in wcslcat and wc...

Hardik Kumar via All-commits all-commits at lists.llvm.org
Thu Jun 25 03:55:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a85dcb8f907416e650d992c0ba52909e64c20611
      https://github.com/llvm/llvm-project/commit/a85dcb8f907416e650d992c0ba52909e64c20611
  Author: Hardik Kumar <hardikkumarpro0005 at gmail.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M libc/src/wchar/wcslcat.cpp
    M libc/src/wchar/wcsncat.cpp
    M libc/test/src/wchar/wcslcat_test.cpp
    M libc/test/src/wchar/wcsncat_test.cpp

  Log Message:
  -----------
  [libc] fix oob and overflow bugs in wcslcat and wcsncat (#203697)

closes #203649 
- I have added a check in `libc/src/wchar/wcslcat.cpp` to prevent
overflow caused by when static_cast wraps the limit.
- For the `wcsncat` implementation I have fixed the condition in the for
loop to first check if `i` is within bounds preventing OOB access on
`s2`

I am new to the codebase so any feedback would be very helpful and I
will be happy to follow up promptly after a review!



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list