qemu-block-device-bounds-checks
来自「xen 3.2.2 源码」· 代码 · 共 24 行
TXT
24 行
Index: ioemu/block.c===================================================================--- ioemu.orig/block.c 2007-05-09 13:31:35.000000000 +0100+++ ioemu/block.c 2007-05-09 13:32:33.000000000 +0100@@ -502,6 +502,9 @@ if (!drv) return -ENOMEDIUM; + if (sector_num < 0)+ return -EINVAL;+ if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { memcpy(buf, bs->boot_sector_data, 512); sector_num++;@@ -539,6 +542,8 @@ return -ENOMEDIUM; if (bs->read_only) return -EACCES;+ if (sector_num < 0)+ return -EINVAL; if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) { memcpy(bs->boot_sector_data, buf, 512); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?