forked from mirrors/tftp-hpa-google
(Finally) handle block number wraparound correctly.
This commit is contained in:
parent
52ffc49262
commit
480bee14e9
3 changed files with 14 additions and 5 deletions
6
CHANGES
6
CHANGES
|
@ -1,5 +1,11 @@
|
||||||
$Id$
|
$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:
|
Changes in 0.23:
|
||||||
Correct memory overwrite bug in the tftp client when compiled
|
Correct memory overwrite bug in the tftp client when compiled
|
||||||
with readline.
|
with readline.
|
||||||
|
|
|
@ -104,7 +104,8 @@ tftp_sendfile(int fd, char *name, char *mode)
|
||||||
struct tftphdr *ap; /* data and ack packets */
|
struct tftphdr *ap; /* data and ack packets */
|
||||||
struct tftphdr *dp;
|
struct tftphdr *dp;
|
||||||
int n;
|
int n;
|
||||||
volatile int block, size, convert;
|
volatile u_short block;
|
||||||
|
volatile int size, convert;
|
||||||
volatile unsigned long amount;
|
volatile unsigned long amount;
|
||||||
struct sockaddr_in from;
|
struct sockaddr_in from;
|
||||||
int fromlen;
|
int fromlen;
|
||||||
|
@ -206,7 +207,8 @@ tftp_recvfile(int fd, char *name, char *mode)
|
||||||
struct tftphdr *ap;
|
struct tftphdr *ap;
|
||||||
struct tftphdr *dp;
|
struct tftphdr *dp;
|
||||||
int n;
|
int n;
|
||||||
volatile int block, size, firsttrip;
|
volatile u_short block;
|
||||||
|
volatile int size, firsttrip;
|
||||||
volatile unsigned long amount;
|
volatile unsigned long amount;
|
||||||
struct sockaddr_in from;
|
struct sockaddr_in from;
|
||||||
int fromlen;
|
int fromlen;
|
||||||
|
|
|
@ -926,7 +926,7 @@ tftp_sendfile(struct formats *pf, struct tftphdr *oap, int oacklen)
|
||||||
{
|
{
|
||||||
struct tftphdr *dp;
|
struct tftphdr *dp;
|
||||||
struct tftphdr *ap; /* ack packet */
|
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;
|
int size, n;
|
||||||
|
|
||||||
ap = (struct tftphdr *)ackbuf;
|
ap = (struct tftphdr *)ackbuf;
|
||||||
|
@ -1036,7 +1036,8 @@ tftp_recvfile(struct formats *pf, struct tftphdr *oap, int oacklen)
|
||||||
int n, size;
|
int n, size;
|
||||||
/* These are "static" to avoid longjmp funnies */
|
/* These are "static" to avoid longjmp funnies */
|
||||||
static struct tftphdr *ap; /* ack buffer */
|
static struct tftphdr *ap; /* ack buffer */
|
||||||
static int block = 0, acksize;
|
static u_short block = 0;
|
||||||
|
static int acksize;
|
||||||
|
|
||||||
dp = w_init();
|
dp = w_init();
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue