Page MenuHomeFreeBSD

libc/tests/string: improve stpncpy() "bounds" unit test
ClosedPublic

Authored by fuz on Dec 10 2025, 9:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 21, 11:11 PM
Unknown Object (File)
Tue, Feb 17, 10:18 AM
Unknown Object (File)
Thu, Jan 29, 2:44 PM
Unknown Object (File)
Jan 27 2026, 11:13 PM
Unknown Object (File)
Jan 20 2026, 4:31 AM
Unknown Object (File)
Jan 20 2026, 2:09 AM
Unknown Object (File)
Jan 18 2026, 3:19 AM
Unknown Object (File)
Jan 10 2026, 4:45 PM
Subscribers

Details

Summary

The test is extended the same way I previously extended the memccpy()
test to fix what is probably the same kind of bug.

PR: 291359
Reported by: Collin Funk <collin.funk1@gmail.com>
Fixes: 6fa9e7d8737548ef93c573387ce62402c368d486 (D42519)
See also: 61ed5748e4e9c7397fcb2638b442f46ac5c9e7c5 (D46051)
MFC after: 1 week

Test Plan

now correctly diagnoses bug #291359, while other
implementations of stpncpy() still pass.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69167
Build 66050: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Dec 10 2025, 9:18 PM
ngie added inline comments.
lib/libc/tests/string/stpncpy_test.c
105
This revision is now accepted and ready to land.Dec 11 2025, 6:58 AM