summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-07-22 15:50:21 -0700
committerJaben Carsey <jaben.carsey@intel.com>2019-07-31 09:52:43 -0700
commit58cc0ffe68e249ffcc73ee3d8e2120be27793f28 (patch)
tree5bf5915e3f6f9511688f5d41defcc19477593920 /ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
parentd21e5dbbbf11589113d39619b3e01eb1e8966819 (diff)
downloadedk2-58cc0ffe68e249ffcc73ee3d8e2120be27793f28.tar.gz
edk2-58cc0ffe68e249ffcc73ee3d8e2120be27793f28.tar.bz2
edk2-58cc0ffe68e249ffcc73ee3d8e2120be27793f28.zip
ShellPkg: acpiview: Allow passing buffer length to DumpGasStruct()
Modify the signature of the DumpGasStruct() function to include the buffer length parameter and to return the number of bytes parsed by the function. This way it becomes possible to prevent buffer overruns when dumping Generic Address Structure's (GAS) fields in the acpiview table parsers. Update all existing DumpGasStruct() calls in acpiview to add the length argument. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c
index 1efcbd40f8..c6929695a1 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c
@@ -134,7 +134,7 @@ DumpDbgDeviceInfo (
AddrSize = (UINT32*)(Ptr + (*AddrSizeOffset));
while (Index < (*GasCount)) {
PrintFieldName (4, L"BaseAddressRegister");
- DumpGasStruct (DataPtr, 4);
+ DumpGasStruct (DataPtr, 4, GAS_LENGTH);
PrintFieldName (4, L"Address Size");
Print (L"0x%x\n", AddrSize[Index]);
DataPtr += GAS_LENGTH;