HomeFreeBSD

Fix 'hostuuid: preload data malformed' warning

Description

Fix 'hostuuid: preload data malformed' warning

If the preloaded hostuuid value is invalid and verbose booting is
enabled, a warning is printed. This printf had two bugs:

  1. It was missing a trailing \n character.
  2. The malformed UUID is printed with %s even though it is not known

to be NUL-terminated.

This commit adds the missing \n and uses %.*s with the (already known)
length of the preloaded UUID to ensure that we don't read past the end
of the buffer.

Reported by: kevans
Fixes: c3188289 Preload hostuuid for early-boot use
MFC after: 3 days

Details

Provenance
cpercivaAuthored on May 15 2021, 5:57 AM
Parents
rG8d2b4b2e7c1e: cxgbe: Cast pointer arguments to trunc_page() to vm_offset_t.
Branches
Unknown
Tags
Unknown