From c9b3fdf3828fe15cfdcaace7c84ad96e90e24a46 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 29 Jul 2007 08:49:16 +0200 Subject: [PATCH] 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 --- verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.25.1