mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-10 22:59:13 +00:00
Prevent intel_fn11 array overruns
First check whether we are past the array, only then read and check its values.
This commit is contained in:
parent
550efe1a32
commit
381b3352c6
1 changed files with 1 additions and 1 deletions
|
@ -721,7 +721,7 @@ static int decode_intel_extended_topology(struct cpu_raw_data_t* raw, struct cpu
|
|||
{
|
||||
int i, level_type, num_smt = -1, num_core = -1;
|
||||
|
||||
for (i = 0; (raw->intel_fn11[i][EAX] != 0x0) && (raw->intel_fn11[i][EBX] != 0x0) && (i < MAX_INTELFN11_LEVEL); i++) {
|
||||
for (i = 0; (i < MAX_INTELFN11_LEVEL) && (raw->intel_fn11[i][EAX] != 0x0) && (raw->intel_fn11[i][EBX] != 0x0); i++) {
|
||||
level_type = EXTRACTS_BITS(raw->intel_fn11[i][ECX], 15, 8);
|
||||
switch (level_type) {
|
||||
case 0x01:
|
||||
|
|
Loading…
Reference in a new issue