[edk2-devel] [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive

Lin, Gary (HPS OE-Linux) gary.lin at hpe.com
Mon Oct 18 07:21:43 UTC 2021


https://bugzilla.tianocore.org/show_bug.cgi?id=3694

HttpBootCheckImageType() was using the case-sensitive AsciiStrCmp() to
check the file extensions and this could reject the images with
upper-case file names. Using the case-insensitive AsciiStriCmp() to
avoid the issue.

Cc: Maciej Rabeda <maciej.rabeda at linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu at intel.com>
Cc: Siyuan Fu <siyuan.fu at intel.com>
Signed-off-by: Gary Lin <gary.lin at hpe.com>
---
 NetworkPkg/HttpBootDxe/HttpBootSupport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index 37a95e031e9c..a91411db7d1b 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -681,11 +681,11 @@ HttpBootCheckImageType (
   }
 
   FilePost = FilePath + AsciiStrLen (FilePath) - 4;
-  if (AsciiStrCmp (FilePost, ".efi") == 0) {
+  if (AsciiStriCmp (FilePost, ".efi") == 0) {
     *ImageType = ImageTypeEfi;
-  } else if (AsciiStrCmp (FilePost, ".iso") == 0) {
+  } else if (AsciiStriCmp (FilePost, ".iso") == 0) {
     *ImageType = ImageTypeVirtualCd;
-  } else if (AsciiStrCmp (FilePost, ".img") == 0) {
+  } else if (AsciiStriCmp (FilePost, ".img") == 0) {
     *ImageType = ImageTypeVirtualDisk;
   } else {
     *ImageType = ImageTypeMax;
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82214): https://edk2.groups.io/g/devel/message/82214
Mute This Topic: https://groups.io/mt/86408257/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list