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 9529D1A1DED for ; Thu, 27 Oct 2016 14:11:05 -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:11:02 +0800 From: Tim Lewis To: "edk2-devel@lists.01.org" Thread-Topic: [shell] AliasLower never used in InternalSetAlias Thread-Index: AdIwlmPP8ooonpLXRf2RvwArhReYzQ== Date: Thu, 27 Oct 2016 21:11:02 +0000 Message-ID: <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 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: [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:11:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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); }