📄 qemu-block-device-bounds-checks
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -