From bd5ec03d87cacc5be2de4284b092aafd4ac4eb31 Mon Sep 17 00:00:00 2001 From: "Lin, Gary (HPS OE-Linux)" Date: Mon, 18 Oct 2021 15:21:43 +0800 Subject: NetworkPkg/HttpBootDxe: make file extension check case-insensitive 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 Cc: Jiaxin Wu Cc: Siyuan Fu Signed-off-by: Gary Lin Reviewed-by: Maciej Rabeda --- 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 37a95e031e..a91411db7d 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; -- cgit v1.2.3