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, Oct 3, 11:16 AM
Unknown Object (File)
Sat, Oct 3, 1:04 AM
Unknown Object (File)
Fri, Oct 2, 7:37 PM
Unknown Object (File)
Fri, Oct 2, 3:30 AM
Unknown Object (File)
Wed, Sep 30, 9:10 PM
Unknown Object (File)
Tue, Sep 29, 5:44 PM
Unknown Object (File)
Tue, Sep 29, 4:35 PM
Unknown Object (File)
Mon, Sep 28, 11:18 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