Page MenuHomeFreeBSD

tftp: Simplify URI handling
ClosedPublic

Authored by des on May 18 2026, 9:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 25, 11:06 AM
Unknown Object (File)
Fri, Jul 24, 4:36 AM
Unknown Object (File)
Mon, Jul 20, 1:27 PM
Unknown Object (File)
Mon, Jul 20, 11:31 AM
Unknown Object (File)
Thu, Jul 16, 4:59 AM
Unknown Object (File)
Thu, Jul 16, 4:18 AM
Unknown Object (File)
Wed, Jul 15, 7:22 AM
Unknown Object (File)
Wed, Jul 15, 7:22 AM
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