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)
Thu, May 14, 3:22 PM
Unknown Object (File)
Wed, May 13, 4:50 PM
Unknown Object (File)
Wed, May 13, 4:40 PM
Unknown Object (File)
Apr 24 2026, 7:58 PM
Unknown Object (File)
Apr 23 2026, 11:21 AM
Unknown Object (File)
Apr 21 2026, 7:39 PM
Unknown Object (File)
Apr 21 2026, 12:11 AM
Unknown Object (File)
Apr 19 2026, 12:51 PM
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