HomeFreeBSD

Fix buffer overrun in gcore(1) NT_PRPSINFO

Description

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.

Reported by: Coverity
CIDs: 1011302, 1011378
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
cemAuthored on
Parents
rS299457: Add data barriers to the arm64 bus_dmamap_sync function. We need these
Branches
Unknown
Tags
Unknown