Skip to content

Example: hello.rs

Running the exmaple.rs example on my machine causes a panic in virt-0.3.1/src/domain.rs:1554

index out of bounds: the len is 0 but the index is 0.

The code never actually checks if sys::virDomainGetMemoryParameters sets nparams to a non-zero length, hence the params vector can have size 0 and indexing the first elem fails.

versions

rust version: rustc 1.75.0 (82e1608df 2023-12-21) cargo version: cargo 1.75.0 (1d8b05cdd 2023-11-20) qemu version: 8.2.0