Skip to content

Commit

Permalink
ShellPkg/SmbiosView: Correct wrong length offset usage in SMBIOS Type4
Browse files Browse the repository at this point in the history
The patch will correct wrong length offset usage in SMBIOS Type4.
For SMBIOS Ver3.6, length should be larger than 0x30.
For SMBIOS Ver3.8, length should be larger than 0x32.

Signed-off-by: Jason Zhao <[email protected]>
  • Loading branch information
jiahuanzhao authored and mergify[bot] committed Oct 22, 2024
1 parent a19f50b commit e2ab098
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ SmbiosPrintStructure (
ShellPrintEx (-1, -1, L"Thread Count 2: %u\n", Struct->Type4->ThreadCount2);
}

if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct->Hdr->Length > 0x2E)) {
if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct->Hdr->Length > 0x30)) {
ShellPrintEx (-1, -1, L"Thread Enabled: %u\n", Struct->Type4->ThreadEnabled);
}

if (AE_SMBIOS_VERSION (0x3, 0x8) && (Struct->Hdr->Length > 0x30)) {
if (AE_SMBIOS_VERSION (0x3, 0x8) && (Struct->Hdr->Length > 0x32)) {
ShellPrintEx (-1, -1, L"Socket Type: %a\n", LibGetSmbiosString (Struct, Struct->Type4->SocketType));
}

Expand Down

0 comments on commit e2ab098

Please sign in to comment.