2009-06-14 13:07:25 -04:00
|
|
|
$OpenBSD: patch-src_tftp_c,v 1.5 2009/06/14 17:07:25 kili Exp $
|
|
|
|
--- src/tftp.c.orig Mon Jun 8 23:12:43 2009
|
|
|
|
+++ src/tftp.c Sat Jun 13 12:05:54 2009
|
|
|
|
@@ -481,7 +481,7 @@ static ssize_t tftp_err(int err, char *packet, char *m
|
2007-03-17 17:55:54 -04:00
|
|
|
{
|
|
|
|
struct errmess {
|
|
|
|
unsigned short op, err;
|
|
|
|
- char message[];
|
2009-06-14 13:07:25 -04:00
|
|
|
+ char message[0];
|
2007-03-17 17:55:54 -04:00
|
|
|
} *mess = (struct errmess *)packet;
|
|
|
|
ssize_t ret = 4;
|
|
|
|
char *errstr = strerror(errno);
|
2009-06-14 13:07:25 -04:00
|
|
|
@@ -508,7 +508,7 @@ static ssize_t get_block(char *packet, struct tftp_tra
|
2007-03-17 17:55:54 -04:00
|
|
|
char *p;
|
|
|
|
struct oackmess {
|
|
|
|
unsigned short op;
|
|
|
|
- char data[];
|
2009-06-14 13:07:25 -04:00
|
|
|
+ char data[0];
|
2007-03-17 17:55:54 -04:00
|
|
|
} *mess = (struct oackmess *)packet;
|
|
|
|
|
|
|
|
p = mess->data;
|
2009-06-14 13:07:25 -04:00
|
|
|
@@ -531,7 +531,7 @@ static ssize_t get_block(char *packet, struct tftp_tra
|
2007-03-17 17:55:54 -04:00
|
|
|
/* send data packet */
|
|
|
|
struct datamess {
|
|
|
|
unsigned short op, block;
|
|
|
|
- unsigned char data[];
|
2009-06-14 13:07:25 -04:00
|
|
|
+ unsigned char data[0];
|
2007-03-17 17:55:54 -04:00
|
|
|
} *mess = (struct datamess *)packet;
|
|
|
|
|
2008-06-05 15:38:39 -04:00
|
|
|
size_t size = transfer->file->size - transfer->offset;
|