OSDN Git Service
(root)
/
mutilities
/
MUtilities.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b91185f
)
Fixed possible stack overflow in CPUFetaures::detect(), regression probably introduce...
author
LoRd_MuldeR
<mulder2@gmx.de>
Sun, 16 Apr 2017 14:34:21 +0000
(16:34 +0200)
committer
LoRd_MuldeR
<mulder2@gmx.de>
Sun, 16 Apr 2017 14:34:21 +0000
(16:34 +0200)
src/CPUFeatures_Win32.cpp
patch
|
blob
|
history
diff --git
a/src/CPUFeatures_Win32.cpp
b/src/CPUFeatures_Win32.cpp
index
35a0fbb
..
b72f071
100644
(file)
--- a/
src/CPUFeatures_Win32.cpp
+++ b/
src/CPUFeatures_Win32.cpp
@@
-45,7
+45,7
@@
MUtils::CPUFetaures::cpu_info_t MUtils::CPUFetaures::detect(void)
//Initialize variables to zero
memset(&features, 0, sizeof(cpu_info_t));
memset(&systemInfo, 0, sizeof(SYSTEM_INFO));
//Initialize variables to zero
memset(&features, 0, sizeof(cpu_info_t));
memset(&systemInfo, 0, sizeof(SYSTEM_INFO));
- memset(
cpuInfo,
0, sizeof(cpuInfo));
+ memset(
&cpuInfo[0],
0, sizeof(cpuInfo));
//Detect the CPU identifier string
MY_CPUID(&cpuInfo[0], 0);
//Detect the CPU identifier string
MY_CPUID(&cpuInfo[0], 0);
@@
-89,10
+89,10
@@
MUtils::CPUFetaures::cpu_info_t MUtils::CPUFetaures::detect(void)
//Detect extended feature flags
if (max_basic_cap >= 7)
{
//Detect extended feature flags
if (max_basic_cap >= 7)
{
- MY_CPUID(&cpuInfo[
1
], 7);
+ MY_CPUID(&cpuInfo[
0
], 7);
if (features.features & FLAG_AVX)
{
if (features.features & FLAG_AVX)
{
- features.features |= CHECK_FLAG(cpuInfo[
2
], 0x00000020, FLAG_AVX2);
+ features.features |= CHECK_FLAG(cpuInfo[
1
], 0x00000020, FLAG_AVX2);
}
}
}
}