mirror of https://github.com/acidanthera/audk.git
RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect HI protocol record size
The size of structure must be minus with byte that is occupied by the initial array. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> Cc: Mike Maslenkin <mike.maslenkin@gmail.com> Reviewed-by: Nickle Wang <nicklew@nvidia.com> Acked-by: Mike Maslenkin <mike.maslenkin@gmail.com>
This commit is contained in:
parent
cf31257ec9
commit
5cdeff1eb3
|
@ -180,7 +180,7 @@ RedfishPlatformHostInterfaceProtocolData (
|
||||||
HostNameLength = (UINT8)AsciiStrSize (HostNameString);
|
HostNameLength = (UINT8)AsciiStrSize (HostNameString);
|
||||||
ThisProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD *)AllocateZeroPool (
|
ThisProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD *)AllocateZeroPool (
|
||||||
sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) - 1 +
|
sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) - 1 +
|
||||||
sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) +
|
sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1 +
|
||||||
HostNameLength
|
HostNameLength
|
||||||
);
|
);
|
||||||
if (ThisProtocolRecord == NULL) {
|
if (ThisProtocolRecord == NULL) {
|
||||||
|
@ -189,7 +189,7 @@ RedfishPlatformHostInterfaceProtocolData (
|
||||||
}
|
}
|
||||||
|
|
||||||
ThisProtocolRecord->ProtocolType = MCHostInterfaceProtocolTypeRedfishOverIP;
|
ThisProtocolRecord->ProtocolType = MCHostInterfaceProtocolTypeRedfishOverIP;
|
||||||
ThisProtocolRecord->ProtocolTypeDataLen = sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) + HostNameLength;
|
ThisProtocolRecord->ProtocolTypeDataLen = sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) -1 + HostNameLength;
|
||||||
RedfishOverIpData = (REDFISH_OVER_IP_PROTOCOL_DATA *)&ThisProtocolRecord->ProtocolTypeData[0];
|
RedfishOverIpData = (REDFISH_OVER_IP_PROTOCOL_DATA *)&ThisProtocolRecord->ProtocolTypeData[0];
|
||||||
//
|
//
|
||||||
// Fill up REDFISH_OVER_IP_PROTOCOL_DATA
|
// Fill up REDFISH_OVER_IP_PROTOCOL_DATA
|
||||||
|
|
Loading…
Reference in New Issue