diff --git a/CHANGES b/CHANGES index 7ad97b2..3478559 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ $Id$ +Changes in 0.24: + Fix bugs in both client and server dealing with block number + wraparound, usually manifesting themselves as failure to + handle files over 32 MB in size. + + Changes in 0.23: Correct memory overwrite bug in the tftp client when compiled with readline. diff --git a/tftp/tftp.c b/tftp/tftp.c index 89297d2..279527b 100644 --- a/tftp/tftp.c +++ b/tftp/tftp.c @@ -104,7 +104,8 @@ tftp_sendfile(int fd, char *name, char *mode) struct tftphdr *ap; /* data and ack packets */ struct tftphdr *dp; int n; - volatile int block, size, convert; + volatile u_short block; + volatile int size, convert; volatile unsigned long amount; struct sockaddr_in from; int fromlen; @@ -206,7 +207,8 @@ tftp_recvfile(int fd, char *name, char *mode) struct tftphdr *ap; struct tftphdr *dp; int n; - volatile int block, size, firsttrip; + volatile u_short block; + volatile int size, firsttrip; volatile unsigned long amount; struct sockaddr_in from; int fromlen; diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index bdcd49d..c019591 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -926,7 +926,7 @@ tftp_sendfile(struct formats *pf, struct tftphdr *oap, int oacklen) { struct tftphdr *dp; struct tftphdr *ap; /* ack packet */ - static int block = 1; /* Static to avoid longjmp funnies */ + static u_short block = 1; /* Static to avoid longjmp funnies */ int size, n; ap = (struct tftphdr *)ackbuf; @@ -1036,8 +1036,9 @@ tftp_recvfile(struct formats *pf, struct tftphdr *oap, int oacklen) int n, size; /* These are "static" to avoid longjmp funnies */ static struct tftphdr *ap; /* ack buffer */ - static int block = 0, acksize; - + static u_short block = 0; + static int acksize; + dp = w_init(); do { timeout = 0;