From 550efe1a328cc839fe074927c5b8980a71712b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Thu, 23 May 2024 09:59:11 +0200 Subject: [PATCH] Fix cpuid_get_hypervisor when NULL data is provided The data should be loaded into the local variable `mydata`, not into the NULL parameter. --- libcpuid/cpuid_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index 791e18d..111f43f 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -1748,7 +1748,7 @@ hypervisor_vendor_t cpuid_get_hypervisor(struct cpu_raw_data_t* raw, struct cpu_ }; if (!data) { - if ((r = cpu_identify(raw, data)) < 0) + if ((r = cpu_identify(raw, &mydata)) < 0) return HYPERVISOR_UNKNOWN; data = &mydata; }