HomeFreeBSD

Fix too small hostname buffer in bootparamd

Description

Fix too small hostname buffer in bootparamd

This fixes the following warning from clang 14:

usr.sbin/bootparamd/bootparamd/bootparamd.c:204:32: error: 'fscanf' may
overflow; destination buffer in argument 3 has size 255, but the
corresponding specifier may require size 256 [-Werror,-Wfortify-source]

The MAX_MACHINE_NAME macro indicates the maximum number of bytes in a
machine name, but it does not include the NUL terminator required for
scanf.

MFC after: 3 days

(cherry picked from commit d310bf3867b4168e57365196c3a31797c0538097)

Details

Provenance
dimAuthored on Feb 6 2022, 2:25 PM
Parents
rG01cccd704844: Explicitly include semaphore.h for struct _sem in fusefs setattr test
Branches
Unknown
Tags
Unknown