From a687f448f938f0660356f3c07e393f93ef7166c4 Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Fri, 11 Sep 2015 00:52:51 +0000 Subject: NetworkPkg: PXE Driver's LoadFile protocol should check FilePath PXE driver's LoadFile protocol should check the input parameter FilePath to see whether it's a supported device path.If not, it should return invalid parameter, do not continue PXE boot. (Sync patch r18436 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18441 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c index cdcf2f0d3e..367a1356ab 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -2328,6 +2328,10 @@ EfiPxeLoadFile ( EFI_STATUS Status; BOOLEAN MediaPresent; + if (FilePath == NULL || !IsDevicePathEnd (FilePath)) { + return EFI_INVALID_PARAMETER; + } + VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This); Private = VirtualNic->Private; PxeBc = &Private->PxeBc; -- cgit v1.2.3