Page MenuHomeFreeBSD

LinuxKPI: Implement strscpy
ClosedPublic

Authored by wulf on Jul 2 2021, 11:41 PM.
Tags
None
Referenced Files
F102760899: D31005.diff
Sat, Nov 16, 7:25 PM
Unknown Object (File)
Sun, Oct 27, 9:02 PM
Unknown Object (File)
Wed, Oct 23, 9:10 PM
Unknown Object (File)
Tue, Oct 22, 9:24 AM
Unknown Object (File)
Tue, Oct 22, 8:36 AM
Unknown Object (File)
Sep 18 2024, 11:18 AM
Unknown Object (File)
Sep 16 2024, 6:44 AM
Unknown Object (File)
Sep 6 2024, 8:00 PM

Details

Summary

strscpy copies the src string, or as much of it as fits, into the dst
buffer. The dst buffer is always NUL terminated, unless it's zero-sized.
strscpy returns the number of characters copied (not including the
trailing NUL) or -E2BIG if len is 0 or src was truncated.

Currently drm-kmod replaces strscpy with strncpy that is not quite
correct as strncpy does not NUL-terminate overflown strings and returns
different values on exit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable