summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp
diff options
context:
space:
mode:
authorgavin <gavin@FreeBSD.org>2010-06-27 14:11:03 +0000
committergavin <gavin@FreeBSD.org>2010-06-27 14:11:03 +0000
commit8b5cecf84ee6b6cd467f39af846db1aeb6257c0c (patch)
tree4a924282ebbb63196a0e056002d34f93b26cbf60 /usr.bin/tftp
parent0a8e6bb7387681d42d401c7941b3f4b84b6a3bba (diff)
downloadFreeBSD-src-8b5cecf84ee6b6cd467f39af846db1aeb6257c0c.zip
FreeBSD-src-8b5cecf84ee6b6cd467f39af846db1aeb6257c0c.tar.gz
Fix core dump when server fails to respond.
Reviewed by: imp
Diffstat (limited to 'usr.bin/tftp')
-rw-r--r--usr.bin/tftp/tftp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index 29ba2b2..c6e1118 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -229,7 +229,10 @@ recvfile(int peer, char *port, int fd, char *name, char *mode)
/* Otherwise it is a fatal error */
break;
}
-
+ if (i == 12) {
+ printf("Transfer timed out.\n");
+ return;
+ }
if (rp->th_opcode == ERROR) {
tftp_log(LOG_ERR, "Error code %d: %s", rp->th_code, rp->th_msg);
return;
OpenPOWER on IntegriCloud