mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
a58a421c36
commit
f1a7d73a68
|
@ -149,7 +149,7 @@ ShellCommandRunDmem (
|
||||||
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
||||||
if (Temp1 == NULL) {
|
if (Temp1 == NULL) {
|
||||||
Address = gST;
|
Address = gST;
|
||||||
Size = 512;
|
Size = sizeof (*gST);
|
||||||
} else {
|
} else {
|
||||||
if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
|
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);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
|
||||||
|
|
Loading…
Reference in New Issue