Skip to content

Commit a12be6b

Browse files
committed
Address review comments
1 parent 9719b0c commit a12be6b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

common/nvram.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ typedef struct PHOENIX_FLASH_MAP_ENTRY_ {
329329
UINT32 Offset;
330330
} PHOENIX_FLASH_MAP_ENTRY;
331331
#define NVRAM_PHOENIX_FLASH_MAP_TOTAL_SIZE 0x1000
332-
#define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_VOLUME 0x0000
332+
#define NVRAM_PHOENIX_FLASH_MAP_MAX_ENTRIES 113
333+
#define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_VOLUME 0x0000
333334
#define NVRAM_PHOENIX_FLASH_MAP_ENTRY_DATA_TYPE_DATA_BLOCK 0x0001
334335

335336
extern UString phoenixFlashMapGuidToUString(const EFI_GUID & guid);

common/nvramparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
494494
+ (variable->attributes()->time_based_auth() << 5)
495495
+ (variable->attributes()->append_write() << 6)
496496
+ (UINT32)(variable->attributes()->reserved() << 7)
497-
+ (variable->attributes()->apple_data_checksum() << 31);
497+
+ (UINT32)(variable->attributes()->apple_data_checksum() << 31);
498498

499499
// Add generic info
500500
info += usprintf("Full size: %Xh (%u)\nHeader size: %Xh (%u)\nBody size: %Xh (%u)\nState: %02Xh\nReserved: %02Xh\nAttributes: %08Xh (",
@@ -976,7 +976,7 @@ USTATUS NvramParser::parseNvramVolumeBody(const UModelIndex & index,const UINT32
976976
// Perform initial sanity check
977977
const PHOENIX_FLASH_MAP_HEADER* storeHeader = (const PHOENIX_FLASH_MAP_HEADER*)(volumeBody.constData() + storeOffset);
978978
if (UByteArray((const char*)storeHeader->Signature, NVRAM_PHOENIX_FLASH_MAP_SIGNATURE_LENGTH) != NVRAM_PHOENIX_FLASH_MAP_SIGNATURE
979-
|| storeHeader->NumEntries > 113) {
979+
|| storeHeader->NumEntries > NVRAM_PHOENIX_FLASH_MAP_MAX_ENTRIES) {
980980
// No need to parse further, not a Phoenix Flash Map
981981
goto not_flm;
982982
}

0 commit comments

Comments
 (0)