summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-10-11 15:51:45 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-10-24 12:18:22 +0800
commitf1a7d73a6880471b2f006044995276f65f44428a (patch)
tree9474b5e4cc07b0c8765f9d4171e353393e40ae45 /ShellPkg/Library/UefiShellDebug1CommandsLib
parenta58a421c3629e5f28b4a6887c28da4ee6976cd61 (diff)
downloadedk2-f1a7d73a6880471b2f006044995276f65f44428a.tar.gz
edk2-f1a7d73a6880471b2f006044995276f65f44428a.tar.bz2
edk2-f1a7d73a6880471b2f006044995276f65f44428a.zip
ShellPkg/dmem: Only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1236 When "dmem" runs without additional arguments, it dumps the memory content of EFI_SYSTEM_TABLE. But today's implementation dumps 512 bytes. It's not correct because sizeof (EFI_SYSTEM_TABLE) is less than 512, the 512-read causes page fault exception in a heap-guard enabled environment. The patch changes the implementation to only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jim Dailey <jim_dailey@.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index f38593a9e9..a4c18c9b68 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -149,7 +149,7 @@ ShellCommandRunDmem (
Temp1 = ShellCommandLineGetRawValue(Package, 1);
if (Temp1 == NULL) {
Address = gST;
- Size = 512;
+ Size = sizeof (*gST);
} else {
if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);