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 <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>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
Lin, Gary (HPS OE-Linux) 2021-10-18 15:21:43 +08:00 committed by mergify[bot]
parent 2f286930a8
commit bd5ec03d87
1 changed files with 3 additions and 3 deletions

View File

@ -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;