From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from msmail.insydesw.com.tw (ms.insydesw.com [211.75.113.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 422341A1DEF for ; Thu, 27 Oct 2016 14:29:04 -0700 (PDT) Received: from msmail.insydesw.com.tw ([fe80::74f7:f173:f4aa:9a05]) by msmail.insydesw.com.tw ([fe80::74f7:f173:f4aa:9a05%11]) with mapi id 14.01.0438.000; Fri, 28 Oct 2016 05:29:02 +0800 From: Tim Lewis To: Tim Lewis , "edk2-devel@lists.01.org" Thread-Topic: [shell] AliasLower never used in InternalSetAlias Thread-Index: AdIwlmPP8ooonpLXRf2RvwArhReYzQAAmqFg Date: Thu, 27 Oct 2016 21:29:01 +0000 Message-ID: <7236196A5DF6C040855A6D96F556A53F3FD173@msmail.insydesw.com.tw> References: <7236196A5DF6C040855A6D96F556A53F3FD11D@msmail.insydesw.com.tw> In-Reply-To: <7236196A5DF6C040855A6D96F556A53F3FD11D@msmail.insydesw.com.tw> Accept-Language: en-US, zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [73.48.186.173] MIME-Version: 1.0 Subject: Re: [shell] AliasLower never used in InternalSetAlias X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 21:29:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I would also note that GetAlias() has similar logic, but does, in fact use = the AliasLower. As far as I can tell, the specification does not say anythi= ng about case-insensitive, so I believe this to be in error. Tim -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Tim = Lewis Sent: Thursday, October 27, 2016 2:11 PM To: edk2-devel@lists.01.org Subject: [edk2] [shell] AliasLower never used in InternalSetAlias In the function InternalSetAlias, it appears that AliasLower is duplicated = (fromAlias), converted to lower case and freed ,but never actually used. Am= I missing something? // Convert to lowercase to make aliases case-insensitive if (Alias !=3D NULL) { AliasLower =3D AllocateCopyPool (StrSize (Alias), Alias); if (AliasLower =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } ToLower (AliasLower); } else { AliasLower =3D NULL; } // // We must be trying to remove one if Alias is NULL // if (Alias =3D=3D NULL) { // // remove an alias (but passed in COMMAND parameter) // Status =3D (gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, = NULL)); } else { // // Add and replace are the same // // We dont check the error return on purpose since the variable may not= exist. gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL); Status =3D (gRT->SetVariable((CHAR16*)Alias, &gShellAliasGuid, EFI_VARI= ABLE_BOOTSERVICE_ACCESS|(Volatile?0:EFI_VARIABLE_NON_VOLATILE), StrSize(Com= mand), (VOID*)Command)); } if (Alias !=3D NULL) { FreePool (AliasLower); } _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel