Page MenuHomeFreeBSD

LinuxKPI: Implement strscpy
ClosedPublic

Authored by wulf on Jul 2 2021, 11:41 PM.
Tags
None
Referenced Files
F176067704: D31005.id91753.diff
Thu, Oct 15, 7:46 PM
F176047673: D31005.id91686.diff
Thu, Oct 15, 3:14 PM
Unknown Object (File)
Sun, Oct 4, 6:49 PM
Unknown Object (File)
Mon, Sep 28, 5:03 PM
Unknown Object (File)
Mon, Sep 28, 4:59 PM
Unknown Object (File)
Mon, Sep 28, 3:30 PM
Unknown Object (File)
Mon, Sep 28, 8:54 AM
Unknown Object (File)
Mon, Sep 28, 8:51 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