1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-01-23 20:06:41 +00:00

Fix cpuid_get_hypervisor when NULL data is provided

The data should be loaded into the local variable
`mydata`, not into the NULL parameter.
This commit is contained in:
Pavol Žáčik 2024-05-23 09:59:11 +02:00 committed by The Tumultuous Unicorn Of Darkness
parent e66eee8c6b
commit 550efe1a32

View file

@ -1748,7 +1748,7 @@ hypervisor_vendor_t cpuid_get_hypervisor(struct cpu_raw_data_t* raw, struct cpu_
}; };
if (!data) { if (!data) {
if ((r = cpu_identify(raw, data)) < 0) if ((r = cpu_identify(raw, &mydata)) < 0)
return HYPERVISOR_UNKNOWN; return HYPERVISOR_UNKNOWN;
data = &mydata; data = &mydata;
} }