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>
This commit is contained in:
committed by
Jaben Carsey
parent
d21e5dbbbf
commit
58cc0ffe68
@ -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;
|
||||
|
Reference in New Issue
Block a user