HomeFreeBSD

lsock_init_port: address issues with initializing sockaddr_un object

Description

lsock_init_port: address issues with initializing sockaddr_un object

  • Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
  • Use SUN_LEN(..) instead of spelling out calculation longhand (inspired by comment by jmallett).

Tested with: dgram and stream support with both bsnmpwalk and snmpwalk

MFC after: 1 week
Reported by: Coverity
CID: 1006825

Details

Provenance
ngieAuthored on
Parents
rS311380: MFC 310315
Branches
Unknown
Tags
Unknown