mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
`get_host_address_range` used `check_range(addr, size)` as a guard then unwrapped `get_slice(addr, size)`. This allowed a span across two regions to hit the unwrap (get_slice limits to one range). If `size` were zero, then the checks were all skipped. Causing a panic later on for an invalid address. Make get_slice the sole authority and reject size==0 explicitly. Callers already handle None. Signed-off-by: Dylan Reid <dgreid@fb.com>