From: Jens Axboe Date: Sun, 29 Jul 2007 06:49:16 +0000 (+0200) Subject: Fix md5 verify X-Git-Tag: fio-1.17~28 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c9b3fdf3828fe15cfdcaace7c84ad96e90e24a46 Fix md5 verify The header_interval/offset changes introduced a bug, doing sizeof on a pointer where it should have been the array. So we didn't compare the full md5, just the first sizeof(pointer) bytes. Signed-off-by: Jens Axboe --- diff --git a/verify.c b/verify.c index 3606ecea..91509e5b 100644 --- a/verify.c +++ b/verify.c @@ -147,7 +147,7 @@ static int verify_io_u_md5(struct verify_header *hdr, struct io_u *io_u, md5_update(&md5_ctx, p, hdr->len - sizeof(*hdr)); - if (memcmp(hdr->md5_digest, md5_ctx.hash, sizeof(md5_ctx.hash))) { + if (memcmp(hdr->md5_digest, md5_ctx.hash, sizeof(hash))) { log_err("md5: verify failed at %llu/%u\n", io_u->offset + header_num * hdr->len, hdr->len);