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, Apr 24, 7:58 PM
Unknown Object (File)
Thu, Apr 23, 11:21 AM
Unknown Object (File)
Tue, Apr 21, 7:39 PM
Unknown Object (File)
Tue, Apr 21, 12:11 AM
Unknown Object (File)
Sun, Apr 19, 12:51 PM
Unknown Object (File)
Sun, Apr 19, 12:51 PM
Unknown Object (File)
Wed, Apr 8, 5:05 AM
Unknown Object (File)
Tue, Apr 7, 11:48 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