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, Jul 17, 5:43 AM
Unknown Object (File)
Thu, Jul 9, 10:49 AM
Unknown Object (File)
Wed, Jul 8, 4:28 PM
Unknown Object (File)
Jun 7 2026, 9:22 PM
Unknown Object (File)
May 14 2026, 3:22 PM
Unknown Object (File)
May 13 2026, 4:50 PM
Unknown Object (File)
May 13 2026, 4:40 PM
Unknown Object (File)
Apr 24 2026, 7:58 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 54016
Build 50906: arc lint + arc unit