]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: PXE Driver's LoadFile protocol should check FilePath
authorZhang Lubo <lubo.zhang@intel.com>
Thu, 10 Sep 2015 09:51:00 +0000 (09:51 +0000)
committerluobozhang <luobozhang@Edk2>
Thu, 10 Sep 2015 09:51:00 +0000 (09:51 +0000)
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 <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18436 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c

index cdcf2f0d3eadd6dd15afcd0d1522e823c852f387..367a1356abccaa0cfaff5e17296f60ade2d9fae3 100644 (file)
@@ -2328,6 +2328,10 @@ EfiPxeLoadFile (
   EFI_STATUS                  Status;\r
   BOOLEAN                     MediaPresent;\r
 \r
+  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
   VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);\r
   Private    = VirtualNic->Private;\r
   PxeBc      = &Private->PxeBc;\r