From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.2764.1610671479429260511 for ; Thu, 14 Jan 2021 16:44:40 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 15 Jan 2021 08:44:32 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , , "'Wenyi Xie'" , "'Wang, Jian J'" , "'Wu, Hao A'" , "'Dong, Eric'" Cc: References: <1610435198-12504-1-git-send-email-xiewenyi2@huawei.com> <1610435198-12504-2-git-send-email-xiewenyi2@huawei.com> <1659F55FB44C27DA.15468@groups.io> In-Reply-To: <1659F55FB44C27DA.15468@groups.io> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIEVESzIgdjEgMS8xXSBNZGVNb2R1bGVQa2cvRmlsZUV4cGxvcmVyTGliOiBBZGQgcmV0dXJuIHZhbHVlIGNoZWNr?= Date: Fri, 15 Jan 2021 08:44:34 +0800 Message-ID: <01a101d6ead7$98933220$c9b99660$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJ/T2N1W09m3AMcfK1DSfP1OrBfsQGXGDgCAi6LrGcCSAg/Oqimov/Q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Create PR https://github.com/tianocore/edk2/pull/1357 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+70264+4905953+8761045@groups.i= o > =E4=BB=A3=E8=A1=A8 gaolim= ing > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B41=E6=9C=8814=E6=97=A5= 9:35 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; dandan.bi@intel.com; = 'Wenyi Xie' > ; 'Wang, Jian J' ; 'Wu, Hao > A' ; 'Dong, Eric' > =E6=8A=84=E9=80=81: songdongkuang@huawei.com > =E4=B8=BB=E9=A2=98: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH EDK2 v1 1/1] > MdeModulePkg/FileExplorerLib: Add return value check >=20 > Reviewed-by: Liming Gao >=20 > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+70200+4905953+8761045@groups= .io > > =E4=BB=A3=E8=A1=A8 Dand= an Bi > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B41=E6=9C=8813=E6=97= =A5 14:07 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: Wenyi Xie ; devel@e= dk2.groups.io; > Wang, > > Jian J ; Wu, Hao A ; Dong, > Eric > > > > =E6=8A=84=E9=80=81: songdongkuang@huawei.com > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH EDK2 v1 1/1] > MdeModulePkg/FileExplorerLib: > > Add return value check > > > > Reviewed-by: Dandan Bi > > > > > > > > Thanks, > > Dandan > > > -----Original Message----- > > > From: Wenyi Xie > > > Sent: Tuesday, January 12, 2021 3:07 PM > > > To: devel@edk2.groups.io; Wang, Jian J ; Wu, > Hao > > A > > > ; Bi, Dandan ; Dong, Eric > > > > > > Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com > > > Subject: [PATCH EDK2 v1 1/1] MdeModulePkg/FileExplorerLib: Add retur= n > > > value check > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3113 > > > According to FAT specification, the length of file path should not l= arger than > > > 260. When the length exceed 260, function FatLocateOFile will return > > > EFI_INVALID_PARAMETER and the parameter FileHandle will be NULL. > > Then > > > on the top-level function=EF=BC=8Can exception happens when the NULL= pointer is > > > passed and be used. > > > So adding return value check after calling LibGetFileHandleFromMenu,= if > > > return value is not success, stop calling LibFindFiles. > > > > > > Cc: Jian J Wang > > > Cc: Hao A Wu > > > Cc: Dandan Bi > > > Cc: Eric Dong > > > Signed-off-by: Wenyi Xie > > > --- > > > MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 12 +++++++---= -- > > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > > > diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c > > > b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c > > > index 13a214b06af9..03630a29bc3b 100644 > > > --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c > > > +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c > > > @@ -1408,12 +1408,14 @@ LibUpdateFileExplorer ( > > > if (NewFileContext->IsDir) { > > > RemoveEntryList (&NewMenuEntry->Link); > > > LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); > > > - LibGetFileHandleFromMenu (NewMenuEntry, &FileHandle); > > > - Status =3D LibFindFiles (FileHandle, NewFileContext->FileName, > > > NewFileContext->DeviceHandle); > > > + Status =3D LibGetFileHandleFromMenu (NewMenuEntry, > &FileHandle); > > > if (!EFI_ERROR (Status)) { > > > - LibUpdateFileExplorePage (); > > > - } else { > > > - LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); > > > + Status =3D LibFindFiles (FileHandle, NewFileContext->FileName= , > > > NewFileContext->DeviceHandle); > > > + if (!EFI_ERROR (Status)) { > > > + LibUpdateFileExplorePage (); > > > + } else { > > > + LibFreeMenu (gFileExplorerPrivate.FsOptionMenu); > > > + } > > > } > > > LibDestroyMenuEntry (NewMenuEntry); > > > } > > > -- > > > 2.20.1.windows.1 > > > > > > > > > > >=20 >=20 >=20 >=20 >=20 >=20 >=20