From f6af36a0fb05b5a37b3dfb153677e28ca5cb3fd8 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Mon, 15 Apr 2019 17:37:42 +0200 Subject: [PATCH] Sanity: sbd-md: prevent unrealistic overflow on sector io calc --- src/sbd-md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sbd-md.c b/src/sbd-md.c index 60a1873..f437c41 100644 --- a/src/sbd-md.c +++ b/src/sbd-md.c @@ -162,9 +162,9 @@ sector_io(struct sbd_context *st, int sector, void *data, int rw) memset(&st->io, 0, sizeof(struct iocb)); if (rw) { - io_prep_pwrite(&st->io, st->devfd, data, sector_size, sector_size * sector); + io_prep_pwrite(&st->io, st->devfd, data, sector_size, (long long) sector_size * sector); } else { - io_prep_pread(&st->io, st->devfd, data, sector_size, sector_size * sector); + io_prep_pread(&st->io, st->devfd, data, sector_size, (long long) sector_size * sector); } if (io_submit(st->ioctx, 1, ios) != 1) { -- 1.8.3.1