HomeFreeBSD

MFC 299458: Fix buffer overrun in gcore(1) NT_PRPSINFO

Description

MFC 299458: Fix buffer overrun in gcore(1) NT_PRPSINFO

Use size of destination buffer, rather than a constant that may or may not
correspond to the source buffer, to restrict the length of copied strings. In
particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1.

Use strlcpy instead of strncpy to ensure the result is nul-terminated. This
seems to be what is expected of these fields.

Details

Provenance
jhbAuthored on
Parents
rS306780: MFC r306522
Branches
Unknown
Tags
Unknown