From: Zhang Lubo Date: Thu, 10 Sep 2015 09:51:00 +0000 (+0000) Subject: NetworkPkg: PXE Driver's LoadFile protocol should check FilePath X-Git-Tag: edk2-stable201903~8883 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=94d449f5df792a485da0aae624968e2ef381aa8a 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. 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/trunk/edk2@18436 6f19259b-4bc3-4df7-8a09-765794883524 --- 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;