On 5/6/20 6:52 PM, Rebecca Cran wrote:
This prevents overflow when printing DWORD fields such as the type 17
tables's extended DIMM size.

Signed-off-by: Rebecca Cran <rebe...@bsdio.com>
Cc: Ray Ni <ray...@intel.com>
Cc: Zhichao Gao <zhichao....@intel.com>
Cc: Philippe Mathieu-Daude <phi...@redhat.com>
---
  .../UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c       | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index a75caff3de34..1ea7b84bd0fa 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -49,7 +49,7 @@
  #define PRINT_STRUCT_VALUE(pStruct, type, element) \
    do { \
      ShellPrintEx(-1,-1,L"%a",#element); \
-    ShellPrintEx(-1,-1,L": %d\n", (pStruct->type->element)); \
+    ShellPrintEx(-1,-1,L": %u\n", (pStruct->type->element)); \
    } while (0);
#define PRINT_STRUCT_VALUE_H(pStruct, type, element) \
@@ -634,8 +634,8 @@ SmbiosPrintStructure (
        NumOfItem = (Struct->Type14->Hdr.Length - 5) / 3;
        PRINT_PENDING_STRING (Struct, Type14, GroupName);
        for (Index = 0; Index < NumOfItem; Index++) {
-        ShellPrintEx(-1,-1,L"ItemType %d: %d\n", Index + 1, 
Struct->Type14->Group[Index].ItemType);
-        ShellPrintEx(-1,-1,L"ItemHandle %d: %d\n", Index + 1, 
Struct->Type14->Group[Index].ItemHandle);
+        ShellPrintEx(-1,-1,L"ItemType %u: %u\n", Index + 1, 
Struct->Type14->Group[Index].ItemType);
+        ShellPrintEx(-1,-1,L"ItemHandle %u: %u\n", Index + 1, 
Struct->Type14->Group[Index].ItemHandle);
        }
      }
      break;


Reviewed-by: Philippe Mathieu-Daude <phi...@redhat.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58738): https://edk2.groups.io/g/devel/message/58738
Mute This Topic: https://groups.io/mt/74032727/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to