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)
Fri, Jan 16, 4:21 AM
Unknown Object (File)
Dec 14 2025, 11:10 AM
Unknown Object (File)
Dec 7 2025, 7:45 AM
Unknown Object (File)
Nov 29 2025, 12:20 AM
Unknown Object (File)
Nov 28 2025, 8:08 AM
Unknown Object (File)
Nov 25 2025, 2:25 PM
Unknown Object (File)
Nov 17 2025, 9:03 PM
Unknown Object (File)
Nov 14 2025, 8:18 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