From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web09.11481.1645455473736658263 for ; Mon, 21 Feb 2022 06:57:54 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NtxJgw7a; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 192.55.52.136, 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=1645455473; x=1676991473; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=O26KKjsVPfwAHZcprXjZMs70y3TLtwPYD+BxPD7aqnM=; b=NtxJgw7aA5E/gxUYEPCgVPW+zg9OAPvb9eR7PMf2a6db3k2jMbMujX32 kJ4YFmDEozUgWmPPNQ31wHk/4KTOVSi5nTX3tKz4VGooFGgvukz+2oNTZ 2k0LejMRUzJHemmFLY2i3IpU3ozXN4CCFTPsajXhT1Qmndhdt3+XBJ20C RNcyjCBeVX2ymrPxF7QLu47+p81axbEZ6+v1kOwJ7YP9tUVNbJStJgUC+ Zv11ArbV1mB6J6jebNlQbpxChhfzyfPi3EZ7+/k/JlmYED4/jP46GY8us wur/b2MCez2ca2OYid2998x5oIG3oxlsiZifAJlijkBZXPWYjHqKE4+Dg Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="231490790" X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="231490790" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 06:57:53 -0800 X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="531880670" Received: from mrabeda-mobl.ger.corp.intel.com (HELO [10.249.156.219]) ([10.249.156.219]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 06:57:51 -0800 Message-ID: <53a5cfb1-ac79-ebeb-9323-dc86bb933695@linux.intel.com> Date: Mon, 21 Feb 2022 15:57:37 +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: [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite To: Heng Luo , devel@edk2.groups.io Cc: Fu Siyuan , Wu Jiaxin References: <20220126051221.3772-1-heng.luo@intel.com> From: "Maciej Rabeda" In-Reply-To: <20220126051221.3772-1-heng.luo@intel.com> Content-Language: pl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 > );