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>
UINT32 Len;\r
\r
for (Index = 0, Len = 0; Index < FragmentCount; Index++) {\r
+ if (FragmentTable[Index].FragmentBuffer == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
Len = Len + FragmentTable[Index].FragmentLength;\r
}\r
\r