Page MenuHomeFreeBSD

LinuxKPI: Implement strscpy
ClosedPublic

Authored by wulf on Jul 2 2021, 11:41 PM.
Tags
None
Referenced Files
F169424782: D31005.id91753.diff
Tue, Sep 1, 12:31 PM
F169375698: D31005.diff
Tue, Sep 1, 8:56 AM
F169325360: D31005.id91686.diff
Tue, Sep 1, 5:06 AM
Unknown Object (File)
Tue, Sep 1, 3:02 AM
Unknown Object (File)
Sun, Aug 30, 1:15 AM
Unknown Object (File)
Thu, Aug 20, 3:01 PM
Unknown Object (File)
Tue, Aug 18, 5:08 AM
Unknown Object (File)
Mon, Aug 17, 8:46 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