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)
Mon, Aug 10, 5:17 PM
Unknown Object (File)
Mon, Aug 10, 4:26 PM
Unknown Object (File)
Mon, Aug 10, 4:25 PM
Unknown Object (File)
Sun, Aug 9, 8:54 AM
Unknown Object (File)
Sun, Aug 9, 6:56 AM
Unknown Object (File)
Wed, Aug 5, 7:56 AM
Unknown Object (File)
Wed, Aug 5, 4:33 AM
Unknown Object (File)
Tue, Aug 4, 4:08 AM
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