HomeFreeBSD

bhyve: Accept a variable-length string name for qemu_fwcfg_add_file.

Description

bhyve: Accept a variable-length string name for qemu_fwcfg_add_file.

It is illegal (UB?) to pass a shorter array to a function argument
that takes a fixed-length array. Do a runtime check for names that
are too long via strlen() instead.

Reviewed by: markj
Reported by: GCC -Wstringop-overread
Differential Revision: https://reviews.freebsd.org/D39211

(cherry picked from commit 61482760a0ca198a9310d450133e9ac792b67955)

Details

Provenance
jhbAuthored on Mar 22 2023, 7:34 PM
Reviewer
markj
Differential Revision
D39211: bhyve: Accept a variable-length string name for qemu_fwcfg_add_file.
Parents
rG0218596e9220: acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace.
Branches
Unknown
Tags
Unknown