From nobody Fri May 3 01:06:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+86076+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86076+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1643173960; cv=none; d=zohomail.com; s=zohoarc; b=a2ZaxGoRoAlL089hYaA/cONsOS1SmDo7HN8UjaK77hxAaiAbbECCe6pOzGYmkqOr6VXT3gTSkIUCmsDgnJNI5HRevegLwnU2tT547X1PxImkmcgdWNLyI+n8xgJQ95CwAi4ZTo+3eIWC1wKztAWpdu5qZa3yc1gpuruOqHJWg5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643173960; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=VaMLMQWOxnfg3SBFAEvRPnUeWaJiqT10KMBrjwLecsU=; b=m1NE8+upWf8Q39E21hJoVuXQhPTDS7QoByoVtNuKhTxt4w/ghx+J0FZ+CLtbZXivkH7nxqX2KPPV4zFE+saRQw0n/Y/f+dnR5Vl20yI3VPjZPTCTYXwOt1unlM1JrszizeSZA5FB9Uh9rFuotErHtPfEjra4gzzv313jAhhDG18= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86076+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1643173960424537.6179393148399; Tue, 25 Jan 2022 21:12:40 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id f6q1YY1788612xFTBRiBp2ZA; Tue, 25 Jan 2022 21:12:39 -0800 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.8753.1643173958034354204 for ; Tue, 25 Jan 2022 21:12:38 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="245314937" X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="245314937" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 21:12:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="479773396" X-Received: from hengluo-dev.ccr.corp.intel.com ([10.239.153.139]) by orsmga006.jf.intel.com with ESMTP; 25 Jan 2022 21:12:35 -0800 From: "Heng Luo" To: devel@edk2.groups.io Cc: Maciej Rabeda , Fu Siyuan , Wu Jiaxin Subject: [edk2-devel] [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite Date: Wed, 26 Jan 2022 13:12:21 +0800 Message-Id: <20220126051221.3772-1-heng.luo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,heng.luo@intel.com X-Gm-Message-State: JQQE9fl6vp2nHJEbWNwSsfVix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1643173959; bh=XQFfYrZoJdydU74sUakJIlvoOGxh4PhKdiJpcO9je+s=; h=Cc:Date:From:Reply-To:Subject:To; b=se2KLyX7+a6AAyXDOVg1pxUBy9NbNhpJpIBvsGnyJRbgFkjuPTdz1yi95tSgZcmBwsc tu5O1i9YZ9js/Cvie3/JSyJxMrKT7h0YikfY0ZS0FSU8A9CynjqU9A2CC8UM+CMuNghWF R9ILIx8CO9YTVBjhiTQQ6wogbH1n7SDCdT0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1643173963271100003 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3813 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 Reviewed-by: Maciej Rabeda --- NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAccess.c | 1= 6 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfig= Access.c b/NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrHiiConfigAc= cess.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 =3D (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * AKMSu= iteCount * 2); + AKMListDisplay =3D (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (AKMS= uiteCount * 2 + 1)); if (AKMListDisplay !=3D NULL) { for (Index =3D 0; Index < AKMSuiteCount; Index++) { + // + // The size of buffer should be 3 CHAR16 for Null-terminated Unico= de 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 =3D (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * Ci= pherSuiteCount * 2); + CipherListDisplay =3D (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (C= ipherSuiteCount * 2 + 1)); if (CipherListDisplay !=3D NULL) { for (Index =3D 0; Index < CipherSuiteCount; Index++) { + // + // The size of buffer should be 3 CHAR16 for Null-terminated Unico= de 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 ); --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86076): https://edk2.groups.io/g/devel/message/86076 Mute This Topic: https://groups.io/mt/88690749/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-