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)
Wed, Jun 12, 7:19 PM
Unknown Object (File)
Mon, Jun 10, 6:33 PM
Unknown Object (File)
Sun, Jun 9, 7:57 AM
Unknown Object (File)
Tue, Jun 4, 9:29 AM
Unknown Object (File)
Apr 30 2024, 1:37 PM
Unknown Object (File)
Apr 30 2024, 1:37 PM
Unknown Object (File)
Apr 30 2024, 1:37 PM
Unknown Object (File)
Apr 30 2024, 7:16 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