We have discovered that tftpd-hpa does not detect a partial upload nor
does it remove the file in case of an interrupted upload. The attached
patch fixes both of these issues. Specifically, it does the following:
1. If the client sent the upload tsize, then verify that it matches
the final file size on disk.
2. And, if the sizes do not match or any other error was encountered
during upload, log a warning and remove the file.
We have tested the patch both manually with curl to confirm the above
error cases are indeed handled as expected, and on our CI system (where
tftpd-hpa is used to communicate result from the VM to the host) for
any regressions.
I am also happy to answer any questions about the issues or the patch.