Page MenuHomeFreeBSD

bsdinstall partedit: Use asprintf to build wrapper command for newfs
ClosedPublic

Authored by jhb on Oct 16 2023, 10:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 8, 5:05 AM
Unknown Object (File)
Tue, Apr 7, 11:48 PM
Unknown Object (File)
Mon, Apr 6, 11:29 AM
Unknown Object (File)
Feb 27 2026, 7:41 PM
Unknown Object (File)
Jan 31 2026, 10:27 AM
Unknown Object (File)
Jan 30 2026, 11:45 PM
Unknown Object (File)
Jan 24 2026, 5:39 PM
Unknown Object (File)
Jan 16 2026, 4:21 AM
Subscribers

Details

Summary

Don't abuse the message[] static buffer used elsewhere for error
messages to generate the command that actually newfs's each
filesystem. Use asprintf to a more aptly-named 'char *command'
variable to construct the string instead. This avoids potential bugs
from truncation of the command string.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable