Page MenuHomeFreeBSD

LinuxKPI: Implement strscpy
ClosedPublic

Authored by wulf on Jul 2 2021, 11:41 PM.
Tags
None
Referenced Files
F132100465: D31005.id91753.diff
Mon, Oct 13, 4:57 PM
F132100460: D31005.id.diff
Mon, Oct 13, 4:57 PM
F132100458: D31005.id91686.diff
Mon, Oct 13, 4:57 PM
Unknown Object (File)
Mon, Oct 13, 3:45 AM
Unknown Object (File)
Thu, Oct 9, 3:04 PM
Unknown Object (File)
Mon, Sep 29, 11:49 PM
Unknown Object (File)
Fri, Sep 26, 12:33 AM
Unknown Object (File)
Sun, Sep 21, 1:59 AM

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