diff options
author | gavin <gavin@FreeBSD.org> | 2010-06-27 14:11:03 +0000 |
---|---|---|
committer | gavin <gavin@FreeBSD.org> | 2010-06-27 14:11:03 +0000 |
commit | 8b5cecf84ee6b6cd467f39af846db1aeb6257c0c (patch) | |
tree | 4a924282ebbb63196a0e056002d34f93b26cbf60 /usr.bin/tftp/tftp.c | |
parent | 0a8e6bb7387681d42d401c7941b3f4b84b6a3bba (diff) | |
download | FreeBSD-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/tftp.c')
-rw-r--r-- | usr.bin/tftp/tftp.c | 5 |
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; |