--- tftpd/src/buf.c 2014/02/24 15:12:31 1.1.2.3 +++ tftpd/src/buf.c 2014/02/24 15:22:39 1.1.2.4 @@ -36,8 +36,8 @@ flushBuffer(int fd) return 0; m = cfg_getAttribute(&cfg, "tftpd", "buf_pad"); - if (m) { - memset(RPACK_NEXT(bf), *m, RPACK_REMAIN(bf)); + if (m && 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)); }