Page MenuHomeFreeBSD

tftp: Simplify URI handling
ClosedPublic

Authored by des on May 18 2026, 9:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 11, 8:48 PM
Unknown Object (File)
Thu, Sep 10, 2:31 PM
Unknown Object (File)
Tue, Sep 8, 3:09 AM
Unknown Object (File)
Sat, Sep 5, 10:33 AM
Unknown Object (File)
Sat, Sep 5, 1:20 AM
Unknown Object (File)
Fri, Aug 28, 12:46 PM
Unknown Object (File)
Fri, Aug 28, 12:45 PM
Unknown Object (File)
Mon, Aug 17, 12:41 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