Page MenuHomeFreeBSD

tftp: Simplify URI handling
ClosedPublic

Authored by des on Mon, May 18, 9:34 PM.
Tags
None
Referenced Files
F157536570: D57070.diff
Fri, May 22, 1:40 PM
Unknown Object (File)
Thu, May 21, 1:22 PM
Unknown Object (File)
Tue, May 19, 8:34 PM
Unknown Object (File)
Tue, May 19, 1:03 PM
Unknown Object (File)
Tue, May 19, 7:09 AM
Unknown Object (File)
Tue, May 19, 4: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