Page MenuHomeFreeBSD

tftp: Simplify URI handling
ClosedPublic

Authored by des on May 18 2026, 9:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 17, 12:41 AM
Unknown Object (File)
Thu, Aug 13, 3:10 AM
Unknown Object (File)
Wed, Aug 12, 12:53 AM
Unknown Object (File)
Tue, Aug 11, 7:54 PM
Unknown Object (File)
Tue, Aug 11, 6:24 PM
Unknown Object (File)
Tue, Aug 11, 3:18 PM
Unknown Object (File)
Mon, Aug 10, 1:50 PM
Unknown Object (File)
Sun, Aug 9, 3:36 PM
Subscribers

Details

Summary
  • No need to copy our argument into a new buffer; it is writeable and will not be reused after we return.
  • Instead of constructing the string "get path" and then splitting it into an argument vector, just construct the vector directly. This avoid potentially overrunning the buffer.
  • Call settftpmode() just once, with either the default mode or the user-provided value we already validated.
  • Use errx() instead of fprintf(stderr) + exit().

Reported by: Moyao, Minghao Fu
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable