* [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite
@ 2022-01-26 5:12 Heng Luo
2022-02-21 14:57 ` Maciej Rabeda
[not found] ` <16D5D5092FF6D34D.32530@groups.io>
0 siblings, 2 replies; 3+ messages in thread
From: Heng Luo @ 2022-01-26 5:12 UTC (permalink / raw)
To: devel; +Cc: Maciej Rabeda, Fu Siyuan, Wu Jiaxin
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 <maciej.rabeda@linux.intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
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
);
--
2.31.1.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite
2022-01-26 5:12 [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite Heng Luo
@ 2022-02-21 14:57 ` Maciej Rabeda
[not found] ` <16D5D5092FF6D34D.32530@groups.io>
1 sibling, 0 replies; 3+ messages in thread
From: Maciej Rabeda @ 2022-02-21 14:57 UTC (permalink / raw)
To: Heng Luo, devel; +Cc: Fu Siyuan, Wu Jiaxin
Hi Heng,
Thanks for the patch.
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
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 <maciej.rabeda@linux.intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Signed-off-by: Heng Luo <heng.luo@intel.com>
> ---
> 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
> );
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite
[not found] ` <16D5D5092FF6D34D.32530@groups.io>
@ 2022-02-21 15:41 ` Maciej Rabeda
0 siblings, 0 replies; 3+ messages in thread
From: Maciej Rabeda @ 2022-02-21 15:41 UTC (permalink / raw)
To: Heng Luo, devel; +Cc: Fu Siyuan, Wu Jiaxin
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 <maciej.rabeda@linux.intel.com>
>
> 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 <maciej.rabeda@linux.intel.com>
>> Cc: Fu Siyuan <siyuan.fu@intel.com>
>> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
>> Signed-off-by: Heng Luo <heng.luo@intel.com>
>> ---
>> 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
>> );
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-21 15:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26 5:12 [PATCH] NetworkPkg: Fix incorrect unicode string of the AKM/Cipher Suite Heng Luo
2022-02-21 14:57 ` Maciej Rabeda
[not found] ` <16D5D5092FF6D34D.32530@groups.io>
2022-02-21 15:41 ` [edk2-devel] " Maciej Rabeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox