aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tftp/tftp.c
diff options
context:
space:
mode:
authorGavin Atkinson <gavin@FreeBSD.org>2010-06-27 14:11:03 +0000
committerGavin Atkinson <gavin@FreeBSD.org>2010-06-27 14:11:03 +0000
commita1ec94b88d3db03ca744027b8281ffcbff7c22f0 (patch)
tree4a924282ebbb63196a0e056002d34f93b26cbf60 /usr.bin/tftp/tftp.c
parentbc96d3d17aa7dcaf9b467a41f97ae88adcdb01ae (diff)
Fix core dump when server fails to respond.
Reviewed by: imp
Notes
Notes: svn path=/head/; revision=209550
Diffstat (limited to 'usr.bin/tftp/tftp.c')
-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 29ba2b26c740..c6e111805977 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;