public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Lin, Gary (HPS OE-Linux)" <gary.lin@hpe.com>
To: <devel@edk2.groups.io>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>,
	Jiaxin Wu <jiaxin.wu@intel.com>, Siyuan Fu <siyuan.fu@intel.com>
Subject: [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive
Date: Mon, 18 Oct 2021 15:21:43 +0800	[thread overview]
Message-ID: <20211018072143.14726-1-gary.lin@hpe.com> (raw)

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@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Gary Lin <gary.lin@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


             reply	other threads:[~2021-10-18  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  7:21 Lin, Gary (HPS OE-Linux) [this message]
2021-10-22  9:47 ` [edk2-devel] [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive Maciej Rabeda
     [not found] ` <16B0514E989550C5.22910@groups.io>
2021-10-22 10:40   ` Maciej Rabeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018072143.14726-1-gary.lin@hpe.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox