Sorry I missed to see FilePath is not used in the function at all.

However, I'd like to know where this requirement comes from? I searched in the section of load file protocol and didn't find such requirement.

Thanks.

Heyi

On 11/20/2015 04:50 PM, Fu, Siyuan wrote:
Hi, Guo

It's not a bug, for EfiPxeLoadFile function the input FilePath should always be 
an end device path node.


-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Heyi Guo
Sent: Friday, November 20, 2015 4:23 PM
To: [email protected]
Cc: Zhang, Lubo <[email protected]>; Heyi Guo <[email protected]>; Tian, Feng 
<[email protected]>
Subject: [edk2] [PATCH] MdeModulePkg/Pxe: Fix bug of checking input FilePath

There is a simple bug in below code and will cause PXE always returning invalid 
parameter:

   if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
     return EFI_INVALID_PARAMETER;

FilePath should *not* be end node, so return invalid parameter when FilePath 
*is* device path end.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <[email protected]>
Cc: Feng Tian <[email protected]>
Cc: Zhang Lubo <[email protected]>
---
  MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c 
b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index 89977e6..1c7b664 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
@@ -2776,7 +2776,7 @@ EfiPxeLoadFile (
    UINT64                      TmpBufSize;
    BOOLEAN                     MediaPresent;
- if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
+  if (FilePath == NULL || IsDevicePathEnd (FilePath)) {
      return EFI_INVALID_PARAMETER;
    }
--
2.6.2

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to