mirror of https://github.com/acidanthera/audk.git
NetworkPkg/HttpDxe: Fix HTTP download OS image over 4G size failure
UINT32 integer overflow will happen once the download OS image over 4G size. This patch is to fix this issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
This commit is contained in:
parent
d3d562b904
commit
6893b16fb9
|
@ -2031,8 +2031,8 @@ HttpTcpReceiveBody (
|
|||
|
||||
if (HttpInstance->LocalAddressIsIPv6) {
|
||||
Rx6Token = &Wrap->TcpWrap.Rx6Token;
|
||||
Rx6Token ->Packet.RxData->DataLength = (UINT32) HttpMsg->BodyLength;
|
||||
Rx6Token ->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) HttpMsg->BodyLength;
|
||||
Rx6Token ->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
|
||||
Rx6Token ->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
|
||||
Rx6Token ->Packet.RxData->FragmentTable[0].FragmentBuffer = (VOID *) HttpMsg->Body;
|
||||
Rx6Token->CompletionToken.Status = EFI_NOT_READY;
|
||||
|
||||
|
@ -2043,8 +2043,8 @@ HttpTcpReceiveBody (
|
|||
}
|
||||
} else {
|
||||
Rx4Token = &Wrap->TcpWrap.Rx4Token;
|
||||
Rx4Token->Packet.RxData->DataLength = (UINT32) HttpMsg->BodyLength;
|
||||
Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) HttpMsg->BodyLength;
|
||||
Rx4Token->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
|
||||
Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
|
||||
Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer = (VOID *) HttpMsg->Body;
|
||||
|
||||
Rx4Token->CompletionToken.Status = EFI_NOT_READY;
|
||||
|
|
Loading…
Reference in New Issue