HomeFreeBSD

stand: use snprintf here

Description

stand: use snprintf here

This code was written prior to snprintf being in the then libstand (now
libsa). Since we have it, use it for extra safety. The code already
tries to be safe, but since we have snprintf as well, the added layer of
protection will suffice. The current code reserves 16 bytes (plus a NUL)
at the end for worst case of inet_ntoa, which is still a little
pessimal, but safe from overflow.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35102

Details

Provenance
impAuthored on Aug 3 2022, 4:50 PM
Reviewer
tsoome
Differential Revision
D35102: stand: use snprintf here
Parents
rG979bc32c7c14: sctp: tweak panic message
Branches
Unknown
Tags
Unknown