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
F149212900: D54169.id167834.diff
Mon, Mar 23, 1:15 AM
F149212884: D54169.id167834.diff
Mon, Mar 23, 1:15 AM
Unknown Object (File)
Sat, Mar 14, 6:07 PM
Unknown Object (File)
Wed, Mar 4, 4:47 PM
Unknown Object (File)
Sat, Feb 21, 11:11 PM
Unknown Object (File)
Feb 17 2026, 10:18 AM
Unknown Object (File)
Jan 29 2026, 2:44 PM
Unknown Object (File)
Jan 27 2026, 11:13 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