--- tftpd/src/buf.c 2014/02/24 15:23:39 1.2 +++ tftpd/src/buf.c 2014/02/24 16:03:56 1.2.2.1 @@ -36,7 +36,7 @@ flushBuffer(int fd) return 0; m = cfg_getAttribute(&cfg, "tftpd", "buf_pad"); - if (m && RPACK_REMAIN(bf)) { + if (m && RPACK_OFF(bf) && RPACK_REMAIN(bf)) { memset(RPACK_NEXT(bf), (u_char) strtol(m, NULL, 0), RPACK_REMAIN(bf)); EVERBOSE(4, "Padding buffer with '%c' len=%d", *m, RPACK_REMAIN(bf)); rpack_rnext(bf, RPACK_REMAIN(bf));