summaryrefslogtreecommitdiffstats
path: root/RedfishPkg/Library
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@amd.com>2023-11-23 18:42:37 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-05 03:27:03 +0000
commit5cdeff1eb3533e9791673495f7636f573c39eaf8 (patch)
tree93e9cfcbd555d44fe842b0486e1f2d6ad25de714 /RedfishPkg/Library
parentcf31257ec905f3a18c63a845eb0171774f535022 (diff)
downloadedk2-5cdeff1eb3533e9791673495f7636f573c39eaf8.tar.gz
edk2-5cdeff1eb3533e9791673495f7636f573c39eaf8.tar.bz2
edk2-5cdeff1eb3533e9791673495f7636f573c39eaf8.zip
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>
Diffstat (limited to 'RedfishPkg/Library')
-rw-r--r--RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
index 237ad4e455..a4c624208a 100644
--- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
+++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
@@ -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) {
@@ -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