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
F153755414: D42239.id.diff
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
Unknown Object (File)
Mon, Apr 6, 11:29 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