Skip to content

Commit

Permalink
RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect HI protocol record size
Browse files Browse the repository at this point in the history
The size of structure must be minus with byte that is
occupied by the initial array.

Signed-off-by: Abner Chang <[email protected]>
Cc: Nickle Wang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Cc: Mike Maslenkin <[email protected]>
Reviewed-by: Nickle Wang <[email protected]>
Acked-by: Mike Maslenkin <[email protected]>
  • Loading branch information
changab authored and mergify[bot] committed Dec 5, 2023
1 parent cf31257 commit 5cdeff1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ RedfishPlatformHostInterfaceProtocolData (
HostNameLength = (UINT8)AsciiStrSize (HostNameString);
ThisProtocolRecord = (MC_HOST_INTERFACE_PROTOCOL_RECORD *)AllocateZeroPool (
sizeof (MC_HOST_INTERFACE_PROTOCOL_RECORD) - 1 +
sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) +
sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1 +
HostNameLength
);
if (ThisProtocolRecord == NULL) {
Expand All @@ -189,7 +189,7 @@ RedfishPlatformHostInterfaceProtocolData (
}

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];
//
// Fill up REDFISH_OVER_IP_PROTOCOL_DATA
Expand Down

0 comments on commit 5cdeff1

Please sign in to comment.