Commit e11b229
committed
Fix heap buffer overflow with -x option
The opt_virtio_blk_img array can be overflowed if more than
VBLK_DEV_MAX virtio-blk devices are specified using the -x option, as
opt_virtio_blk_idx is incremented without bounds checking.
Add a check to ensure that opt_virtio_blk_idx does not exceed
VBLK_DEV_MAX. If the limit is reached, log an error and exit.1 parent 68fa45a commit e11b229
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
0 commit comments