[edk2-devel] [PATCH] ShellPkg: smbiosview - print field values as unsigned integers

Philippe Mathieu-Daudé philmd at redhat.com
Mon Apr 27 08:54:46 UTC 2020


Hi Rebecca,

On 4/25/20 12:55 AM, Rebecca Cran wrote:
> This prevents overflow when printing DWORD fields such as the type 17
> tables's extended DIMM size.

Similar issue with type 14:

         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);


Reviewed-by: Philippe Mathieu-Daude <philmd at redhat.com>

> 
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Zhichao Gao <zhichao.gao at intel.com>
> Signed-off-by: Rebecca Cran <rebecca at bsdio.com>
> ---
>   .../Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c   | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index a75caff3de..be8b7c0a97 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) \
> 


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

View/Reply Online (#58163): https://edk2.groups.io/g/devel/message/58163
Mute This Topic: https://groups.io/mt/73253250/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list