mirror of https://github.com/acidanthera/audk.git
NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use
According the Spec, the FragmentBuffers in FragmentTable are allocated by the application when calling Receive() function. This patch is to check whether the FragmentBuffer is valid or not. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@intel.com> Cc: Ye Ting <ting.ye@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>
This commit is contained in:
parent
5644e5cece
commit
8b40f01a3f
|
@ -40,6 +40,9 @@ TcpChkDataBuf (
|
|||
UINT32 Len;
|
||||
|
||||
for (Index = 0, Len = 0; Index < FragmentCount; Index++) {
|
||||
if (FragmentTable[Index].FragmentBuffer == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
Len = Len + FragmentTable[Index].FragmentLength;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue