HomeFreeBSD

bsdinstall partedit: Avoid potential buffer overflow in newfs_command

Description

bsdinstall partedit: Avoid potential buffer overflow in newfs_command

Allocate the buffer holding the newfs command string dynamically
(building the string via open_memstream) rather than storing the
command into a caller-supplied buffer of unknown length.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42237

(cherry picked from commit ae2fc74fe76ca8b89c5ef0081ef3f4008f83de41)

Details

Provenance
jhbAuthored on Oct 16 2023, 11:25 PM
Reviewer
emaste
Differential Revision
D42237: bsdinstall partedit: Avoid potential buffer overflow in newfs_command
Parents
rG950162c4d33a: ctl: Use ctl_io_sbuf in ctl_process_done
Branches
Unknown
Tags
Unknown