From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.181.1645458176443249505 for ; Mon, 21 Feb 2022 07:42:56 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=eCd4uyrN; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 134.134.136.126, mailfrom: maciej.rabeda@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645458176; x=1676994176; h=message-id:date:mime-version:subject:from:to:cc:reply-to: references:in-reply-to:content-transfer-encoding; bh=Zs2t23/iU6LDNQ9E8RtFj5wNC/8vdwrEv5HQUw/9eRs=; b=eCd4uyrN+Wr79MqUk4SKMU0LNlkDqOkrHYBojk47XkTaMPexajpwgixW ARS+n8y77EQocGaitmLoUbHgEN9J3s2hUGx7rkb8Z0YmLT5Tw5gA1oVOR lHvaxbz01bjrKvSjzmRGpapYDsDGkzf8K2jcZZBq+QCmTrTDG/+Mx/tLD 0hoB6HGbT5b+vyh5OsBNG0D6zHOU/1d+E00FoieduGy2DOA+w0acZVVyf +Pj55q9IqxUFJ5YGB818OtffxblM3X+p6yo8bjAPRJU0zYaph1Nb1g+Iv VRrbsmSir8iyMHjWIDs9Zdqd2e/zCDbTvpUe7za8oNPNVhVEsSS51HR0H w==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="235070200" X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="235070200" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 07:42:55 -0800 X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="547378410" Received: from mrabeda-mobl.ger.corp.intel.com (HELO [10.249.156.219]) ([10.249.156.219]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 07:42:54 -0800 Message-ID: <3ba904f6-94fd-74a9-2693-59c37cb59d6a@linux.intel.com> Date: Mon, 21 Feb 2022 16:41:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [edk2-devel] [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite From: "Maciej Rabeda" To: Heng Luo , devel@edk2.groups.io Cc: Fu Siyuan , Wu Jiaxin Reply-To: devel@edk2.groups.io, maciej.rabeda@linux.intel.com References: <20220126051221.3772-1-heng.luo@intel.com> <16D5D5092FF6D34D.32530@groups.io> In-Reply-To: <16D5D5092FF6D34D.32530@groups.io> Content-Language: pl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Patch merged. PR: https://github.com/tianocore/edk2/pull/2536 Commit: https://github.com/tianocore/edk2/pull/2536/commits/18feb439545443e8a3488b82415023601d116fe4 W dniu 21-Feb-22 o 15:57, Maciej Rabeda pisze: > Hi Heng, > > Thanks for the patch. > Reviewed-by: Maciej Rabeda > > W dniu 26-Jan-22 o 06:12, Heng Luo pisze: >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3813 >> >> The size of buffer should be 3 CHAR16 for Null-terminated Unicode >> string. >> The first char is the AKM/Cipher Suite number, the second char is ' ', >> the third char is '\0'. >> >> Cc: Maciej Rabeda >> Cc: Fu Siyuan >> Cc: Wu Jiaxin >> Signed-off-by: Heng Luo >> --- >> NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c >> | 16 ++++++++++++---- >>   1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git >> a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c >> b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c >> index b49825bcb7..7cb2bfc281 100644 >> --- >> a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c >> +++ >> b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c >> @@ -280,12 +280,16 @@ WifiMgrGetStrAKMList ( >>       // >>       // Current AKM Suite is between 1-9 >>       // >> -    AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * >> AKMSuiteCount * 2); >> +    AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * >> (AKMSuiteCount * 2 + 1)); >>       if (AKMListDisplay != NULL) { >>         for (Index = 0; Index < AKMSuiteCount; Index++) { >> +        // >> +        // The size of buffer should be 3 CHAR16 for Null-terminated >> Unicode string. >> +        // The first char is the AKM Suite number, the second char >> is ' ', the third char is '\0'. >> +        // >>           UnicodeSPrint ( >>             AKMListDisplay + (Index * 2), >> -          sizeof (CHAR16) * 2, >> +          sizeof (CHAR16) * 3, >>             L"%d ", >> Profile->Network.AKMSuite->AKMSuiteList[Index].SuiteType >>             ); >> @@ -333,12 +337,16 @@ WifiMgrGetStrCipherList ( >>       // >>       // Current Cipher Suite is between 1-9 >>       // >> -    CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) >> * CipherSuiteCount * 2); >> +    CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) >> * (CipherSuiteCount * 2 + 1)); >>       if (CipherListDisplay != NULL) { >>         for (Index = 0; Index < CipherSuiteCount; Index++) { >> +        // >> +        // The size of buffer should be 3 CHAR16 for Null-terminated >> Unicode string. >> +        // The first char is the Cipher Suite number, the second >> char is ' ', the third char is '\0'. >> +        // >>           UnicodeSPrint ( >>             CipherListDisplay + (Index * 2), >> -          sizeof (CHAR16) * 2, >> +          sizeof (CHAR16) * 3, >>             L"%d ", >> Profile->Network.CipherSuite->CipherSuiteList[Index].SuiteType >>             ); > > > > > >