]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Should pass in bytes of string buffer to UnicodeSPrint() rather than Unicode string...
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 29 Aug 2012 09:23:34 +0000 (09:23 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 29 Aug 2012 09:23:34 +0000 (09:23 +0000)
Signed-off-by: Tian Feng <feng.tian@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13691 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
MdePkg/Library/UefiDebugLibConOut/DebugLib.c
MdePkg/Library/UefiDebugLibStdErr/DebugLib.c

index 7d4f33d409601bae44f9041cafdf3552bfb8f2c0..7317767c005f50e0c4f897fa7aa5334668ae4780 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Dynamically update the pages.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1191,7 +1191,7 @@ GetLegacyBootOptionVar (
   }\r
   \r
   for (Index = 0; Index < OrderSize / sizeof (UINT16); Index++) {\r
-    UnicodeSPrint (StrTemp, 100, L"Boot%04x", OrderBuffer[Index]);\r
+    UnicodeSPrint (StrTemp, sizeof (StrTemp), L"Boot%04x", OrderBuffer[Index]);\r
     OptionBuffer = BdsLibGetVariableAndSize (\r
                     StrTemp,\r
                     &gEfiGlobalVariableGuid,\r
index 74ab8b8ed784b284ba390875f09cfbef4d06eb68..702f4f43cf61d4103325e963fc026d6f12c64b24 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper functions for configuring or getting the parameters relating to iSCSI.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -94,7 +94,7 @@ IScsiParseIsIdFromString (
   if (StrLen (IsIdStr) != 6) {\r
     UnicodeSPrint (\r
       PortString,\r
-      (UINTN) ISCSI_NAME_IFR_MAX_SIZE,\r
+      (UINTN) sizeof (PortString),\r
       L"Error! Input is incorrect, please input 6 hex numbers!\n"\r
       );\r
 \r
@@ -700,7 +700,7 @@ IScsiFormCallback (
       ConfigFormEntry = IScsiGetConfigFormEntryByIndex ((UINT32) (QuestionId - KEY_DEVICE_ENTRY_BASE));\r
       ASSERT (ConfigFormEntry != NULL);\r
 \r
-      UnicodeSPrint (PortString, (UINTN) 128, L"Port %s", ConfigFormEntry->MacString);\r
+      UnicodeSPrint (PortString, (UINTN) sizeof (PortString), L"Port %s", ConfigFormEntry->MacString);\r
       DeviceFormTitleToken = (EFI_STRING_ID) STR_ISCSI_DEVICE_FORM_TITLE;\r
       HiiSetString (Private->RegisteredHandle, DeviceFormTitleToken, PortString, NULL);\r
 \r
@@ -1034,13 +1034,13 @@ IScsiConfigUpdateForm (
       //\r
       // Compose the Port string and create a new EFI_STRING_ID.\r
       //\r
-      UnicodeSPrint (PortString, 128, L"Port %s", ConfigFormEntry->MacString);\r
+      UnicodeSPrint (PortString, sizeof (PortString), L"Port %s", ConfigFormEntry->MacString);\r
       ConfigFormEntry->PortTitleToken = HiiSetString (mCallbackInfo->RegisteredHandle, 0, PortString, NULL);\r
 \r
       //\r
       // Compose the help string of this port and create a new EFI_STRING_ID.\r
       //\r
-      UnicodeSPrint (PortString, 128, L"Set the iSCSI parameters on port %s", ConfigFormEntry->MacString);\r
+      UnicodeSPrint (PortString, sizeof (PortString), L"Set the iSCSI parameters on port %s", ConfigFormEntry->MacString);\r
       ConfigFormEntry->PortTitleHelpToken = HiiSetString (mCallbackInfo->RegisteredHandle, 0, PortString, NULL);\r
 \r
       InsertTailList (&mIScsiConfigFormList, &ConfigFormEntry->Link);\r
index 27be635e9c7c1b6e21b0c07e530c044564585a8b..1a47f2b0a901c063f46e6dc3a9edc829113b02ab 100644 (file)
@@ -1071,7 +1071,7 @@ IfrToString (
       CopyMem (TmpBuf, Value.Buffer, Value.BufferLen * sizeof (CHAR16));\r
       PrintFormat = L"%s";  \r
     }\r
-    UnicodeSPrint (Buffer, MAXIMUM_VALUE_CHARACTERS, PrintFormat, Value.Buffer);  \r
+    UnicodeSPrint (Buffer, sizeof (Buffer), PrintFormat, Value.Buffer);  \r
     String = Buffer; \r
     FreePool (TmpBuf);\r
     FreePool (Value.Buffer);\r
index ce4b32426d859c94ddced2e11fa330d50550b548..e0ac471f95bb1521510a5e97ff296ff05bf4543d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Debug Library that sends messages to the Console Output Device in the EFI System Table.\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -120,7 +120,7 @@ DebugAssert (
   //\r
   UnicodeSPrintAsciiFormat (\r
     Buffer, \r
-    MAX_DEBUG_MESSAGE_LENGTH\r
+    sizeof (Buffer)\r
     "ASSERT %a(%d): %a\n", \r
     FileName, \r
     LineNumber, \r
index 73c720497cd8193e610e5cb106d3be58b62ab998..a0aa873a4e52426a959c0bac4e06d757bea6f2a8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Debug Lib that sends messages to the Standard Error Device in the EFI System Table.\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -121,7 +121,7 @@ DebugAssert (
   //\r
   UnicodeSPrintAsciiFormat (\r
     Buffer, \r
-    MAX_DEBUG_MESSAGE_LENGTH,\r
+    sizeof (Buffer),\r
     "ASSERT %a(%d): %a\n", \r
     FileName, \r
     LineNumber, \r