Fix TotalSize check

This commit is contained in:
Nikolaj Schlej 2019-09-05 12:58:51 -07:00
parent 3507698136
commit 8bddbe7d1f
2 changed files with 3 additions and 3 deletions

View File

@ -1249,8 +1249,8 @@ BOOLEAN FfsParser::microcodeHeaderValid(const INTEL_MICROCODE_HEADER* ucodeHeade
return FALSE; return FALSE;
} }
// Check TotalSize to be greater then DataSize snd less than 0x1000000 // Check TotalSize to be greater or equal than DataSize and less than 0x1000000
if (ucodeHeader->TotalSize <= ucodeHeader->DataSize || if (ucodeHeader->TotalSize < ucodeHeader->DataSize ||
ucodeHeader->TotalSize > 0xFFFFFF) { ucodeHeader->TotalSize > 0xFFFFFF) {
return FALSE; return FALSE;
} }

View File

@ -61,7 +61,7 @@ typedef struct {
// This scructure is described in Section 9.11.1 of the Intel Software Developer manual Volume 3A Part 1 // This scructure is described in Section 9.11.1 of the Intel Software Developer manual Volume 3A Part 1
typedef struct INTEL_MICROCODE_HEADER_ { typedef struct INTEL_MICROCODE_HEADER_ {
UINT32 Version; // 0x00000001 UINT32 Version; // 0x00000001
UINT32 Revision; // Sane values are less than 0x100 UINT32 Revision;
UINT16 DateYear; // BCD UINT16 DateYear; // BCD
UINT8 DateDay; // BCD UINT8 DateDay; // BCD
UINT8 DateMonth; // BCD UINT8 DateMonth; // BCD