--- tftpd/src/buf.c 2014/02/24 14:38:47 1.1.2.1 +++ tftpd/src/buf.c 2014/02/24 14:49:03 1.1.2.2 @@ -31,7 +31,7 @@ flushBuffer(int fd) { int ret = 0; - if (!cli.addr.sa.sa_len) + if (!bf || !cli.addr.sa.sa_len || cli.opc != TFTP_OPC_WRQ) return 0; ret = write(fd, RPACK_BUF(bf), RPACK_OFF(bf));