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, Sep 11, 1:20 AM
Unknown Object (File)
Wed, Sep 9, 9:22 AM
Unknown Object (File)
Wed, Sep 9, 9:22 AM
Unknown Object (File)
Wed, Sep 9, 9:13 AM
Unknown Object (File)
Wed, Sep 9, 9:13 AM
Unknown Object (File)
Tue, Aug 25, 11:57 AM
Unknown Object (File)
Thu, Aug 20, 1:33 PM
Unknown Object (File)
Thu, Aug 20, 3:28 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