//\r
// Current AKM Suite is between 1-9\r
//\r
- AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * AKMSuiteCount * 2);\r
+ AKMListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (AKMSuiteCount * 2 + 1));\r
if (AKMListDisplay != NULL) {\r
for (Index = 0; Index < AKMSuiteCount; Index++) {\r
+ //\r
+ // The size of buffer should be 3 CHAR16 for Null-terminated Unicode string.\r
+ // The first char is the AKM Suite number, the second char is ' ', the third char is '\0'.\r
+ //\r
UnicodeSPrint (\r
AKMListDisplay + (Index * 2),\r
- sizeof (CHAR16) * 2,\r
+ sizeof (CHAR16) * 3,\r
L"%d ",\r
Profile->Network.AKMSuite->AKMSuiteList[Index].SuiteType\r
);\r
//\r
// Current Cipher Suite is between 1-9\r
//\r
- CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * CipherSuiteCount * 2);\r
+ CipherListDisplay = (CHAR16 *)AllocateZeroPool (sizeof (CHAR16) * (CipherSuiteCount * 2 + 1));\r
if (CipherListDisplay != NULL) {\r
for (Index = 0; Index < CipherSuiteCount; Index++) {\r
+ //\r
+ // The size of buffer should be 3 CHAR16 for Null-terminated Unicode string.\r
+ // The first char is the Cipher Suite number, the second char is ' ', the third char is '\0'.\r
+ //\r
UnicodeSPrint (\r
CipherListDisplay + (Index * 2),\r
- sizeof (CHAR16) * 2,\r
+ sizeof (CHAR16) * 3,\r
L"%d ",\r
Profile->Network.CipherSuite->CipherSuiteList[Index].SuiteType\r
);\r