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.web11.1877.1610588131777655436 for ; Wed, 13 Jan 2021 17:35:32 -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 ; Thu, 14 Jan 2021 09:35:24 +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> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIEVESzIgdjEgMS8xXSBNZGVNb2R1bGVQa2cvRmlsZUV4cGxvcmVyTGliOiBBZGQgcmV0dXJuIHZhbHVlIGNoZWNr?= Date: Thu, 14 Jan 2021 09:35:26 +0800 Message-ID: <010c01d6ea15$896f16a0$9c4d43e0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJ/T2N1W09m3AMcfK1DSfP1OrBfsQGXGDgCAi6LrGeot18T4A== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=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.i= o > =E4=BB=A3=E8=A1=A8 Dandan= 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@edk= 2.groups.io; Wang, > Jian J ; Wu, Hao A ; Dong, Er= ic > > =E6=8A=84=E9=80=81: songdongkuang@huawei.com > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH EDK2 v1 1/1] MdeModulePkg/Fi= leExplorerLib: > Add return value check >=20 > Reviewed-by: Dandan Bi >=20 >=20 >=20 > Thanks, > Dandan > > -----Original Message----- > > From: Wenyi Xie > > Sent: Tuesday, January 12, 2021 3:07 PM > > To: devel@edk2.groups.io; Wang, Jian J ; Wu, Ha= o > A > > ; Bi, Dandan ; Dong, Eric > > > > Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com > > Subject: [PATCH EDK2 v1 1/1] MdeModulePkg/FileExplorerLib: Add return > > value check > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3113 > > According to FAT specification, the length of file path should not lar= ger 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 p= ointer is > > passed and be used. > > So adding return value check after calling LibGetFileHandleFromMenu, i= f > > 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