Author: gavin
Date: Sun Jun 27 14:11:03 2010
New Revision: 209550
URL: http://svn.freebsd.org/changeset/base/209550

Log:
  Fix core dump when server fails to respond.
  
  Reviewed by:  imp

Modified:
  head/usr.bin/tftp/tftp.c

Modified: head/usr.bin/tftp/tftp.c
==============================================================================
--- head/usr.bin/tftp/tftp.c    Sun Jun 27 12:19:09 2010        (r209549)
+++ head/usr.bin/tftp/tftp.c    Sun Jun 27 14:11:03 2010        (r209550)
@@ -229,7 +229,10 @@ recvfile(int peer, char *port, int fd, c
                /* 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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to