From a502e44f177cbb629f1b1eac6611e0e390352481 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 14 Jan 2020 21:05:15 +0100 Subject: [PATCH] Added a sanity check to the Iomega ZIP code. --- src/disk/zip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/disk/zip.c b/src/disk/zip.c index ccc2fd1c2..5e962115c 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -1173,7 +1173,8 @@ zip_blocks(zip_t *dev, int32_t *len, int first_batch, int out) *len = dev->requested_blocks << 9; for (i = 0; i < dev->requested_blocks; i++) { - fseek(dev->drv->f, dev->drv->base + (dev->sector_pos << 9) + (i << 9), SEEK_SET); + if (fseek(dev->drv->f, dev->drv->base + (dev->sector_pos << 9) + (i << 9), SEEK_SET) == 1) + break; if (feof(dev->drv->f)) break;