mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Fix incorrect parameter check in PXE.Mtftp() function.
According to UEFI spec, the PXE.Mtftp() should return invalid parameter if the BufferPtr parameter was NULL and the DontUseBuffer parameter was FALSE. The DontUseBuffer is only used when perform MTFTP/TFTP read operation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
d02a848e32
commit
cf9ff46b08
|
@ -855,11 +855,19 @@ EfiPxeBcMtftp (
|
|||
(Filename == NULL) ||
|
||||
(BufferSize == NULL) ||
|
||||
(ServerIp == NULL) ||
|
||||
((BufferPtr == NULL) && DontUseBuffer) ||
|
||||
((BlockSize != NULL) && (*BlockSize < PXE_MTFTP_DEFAULT_BLOCK_SIZE))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (Operation == EFI_PXE_BASE_CODE_TFTP_READ_FILE ||
|
||||
Operation == EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY ||
|
||||
Operation == EFI_PXE_BASE_CODE_MTFTP_READ_FILE ||
|
||||
Operation == EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY) {
|
||||
if (BufferPtr == NULL && !DontUseBuffer) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
Config = NULL;
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
|
||||
|
|
Loading…
Reference in New Issue