source: trunk/packages/xen-3.1/xen-3.1/tools/ioemu/patches/qemu-block-device-bounds-checks @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 651 bytes
Line 
1Index: ioemu/block.c
2===================================================================
3--- ioemu.orig/block.c  2007-05-03 14:55:04.000000000 +0100
4+++ ioemu/block.c       2007-05-03 14:59:20.000000000 +0100
5@@ -420,6 +420,8 @@
6 
7     if (!bs->inserted)
8         return -1;
9+    if (sector_num < 0)
10+       return -1;
11 
12     while (nb_sectors > 0) {
13         if (sector_num == 0 && bs->boot_sector_enabled) {
14@@ -458,6 +460,8 @@
15         return -1;
16     if (bs->read_only)
17         return -1;
18+    if (sector_num < 0)
19+       return -1;
20     if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) {
21         memcpy(bs->boot_sector_data, buf, 512);   
22     }
Note: See TracBrowser for help on using the repository browser.