aboutsummaryrefslogtreecommitdiff
path: root/hw/fdc.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-10 23:07:39 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-10 23:07:39 +0000
commit3bcb80f1af107c25bf8c255f3ca88ac467f27a1a (patch)
tree319787f99cfacd2296dc0c779fc6cab33073ed28 /hw/fdc.c
parenta42aa815715dc1db881f5480a50bd331bbd5e923 (diff)
downloadqemu-3bcb80f1af107c25bf8c255f3ca88ac467f27a1a.zip
qemu-3bcb80f1af107c25bf8c255f3ca88ac467f27a1a.tar.gz
qemu-3bcb80f1af107c25bf8c255f3ca88ac467f27a1a.tar.bz2
Fix sector size overflow, by Herbert Xu.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2237 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/fdc.c')
-rw-r--r--hw/fdc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index 930c0e2..073dafa 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -888,7 +888,7 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction)
fdctrl->data_len = fdctrl->fifo[8];
} else {
int tmp;
- fdctrl->data_len = 128 << fdctrl->fifo[5];
+ fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]);
tmp = (cur_drv->last_sect - ks + 1);
if (fdctrl->fifo[0] & 0x80)
tmp += cur_drv->last_sect;