verify: fix potential buffer overrun in dump_buf()