* [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive
@ 2021-10-18 7:21 Lin, Gary (HPS OE-Linux)
2021-10-22 9:47 ` [edk2-devel] " Maciej Rabeda
[not found] ` <16B0514E989550C5.22910@groups.io>
0 siblings, 2 replies; 3+ messages in thread
From: Lin, Gary (HPS OE-Linux) @ 2021-10-18 7:21 UTC (permalink / raw)
To: devel; +Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive
2021-10-18 7:21 [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive Lin, Gary (HPS OE-Linux)
@ 2021-10-22 9:47 ` Maciej Rabeda
[not found] ` <16B0514E989550C5.22910@groups.io>
1 sibling, 0 replies; 3+ messages in thread
From: Maciej Rabeda @ 2021-10-22 9:47 UTC (permalink / raw)
To: devel, gary.lin; +Cc: Jiaxin Wu, Siyuan Fu
Thanks for the patch.
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
On 18-Oct-21 09:21, Lin, Gary (HPS OE-Linux) wrote:
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive
[not found] ` <16B0514E989550C5.22910@groups.io>
@ 2021-10-22 10:40 ` Maciej Rabeda
0 siblings, 0 replies; 3+ messages in thread
From: Maciej Rabeda @ 2021-10-22 10:40 UTC (permalink / raw)
To: devel, gary.lin; +Cc: Jiaxin Wu, Siyuan Fu
Patch merged.
PR: https://github.com/tianocore/edk2/pull/2107
On 22-Oct-21 11:47, Maciej Rabeda wrote:
> Thanks for the patch.
>
> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
>
> On 18-Oct-21 09:21, Lin, Gary (HPS OE-Linux) wrote:
>> 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;
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-22 10:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-18 7:21 [PATCH 1/1] NetworkPkg/HttpBootDxe: make file extension check case-insensitive Lin, Gary (HPS OE-Linux)
2021-10-22 9:47 ` [edk2-devel] " Maciej Rabeda
[not found] ` <16B0514E989550C5.22910@groups.io>
2021-10-22 10:40 ` Maciej Rabeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox