Fix md5 verify
authorJens Axboe <jens.axboe@oracle.com>
Sun, 29 Jul 2007 06:49:16 +0000 (08:49 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Sun, 29 Jul 2007 06:49:16 +0000 (08:49 +0200)
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 <jens.axboe@oracle.com>
verify.c

index 3606ecea77d611e81cd026a3c7fbb7db954d0663..91509e5b7819426c1576fb8f81896c2de1b1a896 100644 (file)
--- 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));
 
 
        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);
                log_err("md5: verify failed at %llu/%u\n",
                              io_u->offset + header_num * hdr->len,
                              hdr->len);