aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/block.c4
-rw-r--r--src/disk.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/block.c b/src/block.c
index 43af305..3f7ecb1 100644
--- a/src/block.c
+++ b/src/block.c
@@ -485,6 +485,10 @@ process_op(struct disk_op_s *op)
{
ASSERT16();
int ret, origcount = op->count;
+ if (origcount * GET_GLOBALFLAT(op->drive_gf->blksize) > 64*1024) {
+ op->count = 0;
+ return DISK_RET_EBOUNDARY;
+ }
u8 type = GET_GLOBALFLAT(op->drive_gf->type);
switch (type) {
case DTYPE_FLOPPY:
diff --git a/src/disk.c b/src/disk.c
index fe2e2c3..0e0af24 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -173,6 +173,7 @@ disk_1300(struct bregs *regs, struct drive_s *drive_gf)
struct disk_op_s dop;
dop.drive_gf = drive_gf;
dop.command = CMD_RESET;
+ dop.count = 0;
int status = send_disk_op(&dop);
disk_ret(regs, status);
}
@@ -322,6 +323,7 @@ disk_1310(struct bregs *regs, struct drive_s *drive_gf)
struct disk_op_s dop;
dop.drive_gf = drive_gf;
dop.command = CMD_ISREADY;
+ dop.count = 0;
int status = send_disk_op(&dop);
disk_ret(regs, status);
}