X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FApplication%2FUiApp%2FFrontPage.c;h=ad5af2cebbd3a54d0af90cd02fccacb053dee52f;hp=bda5ff9231b98eb6853515fad4c1a7f07eba98b1;hb=9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536;hpb=0438f5e287fa40c7aa143c3a151c5e5c743411b3 diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c index bda5ff9231..ad5af2cebb 100644 --- a/MdeModulePkg/Application/UiApp/FrontPage.c +++ b/MdeModulePkg/Application/UiApp/FrontPage.c @@ -1,7 +1,7 @@ /** @file FrontPage routines to handle the callbacks and browser calls -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -408,9 +408,16 @@ ConvertProcessorToString ( DestMax = 0x20 / sizeof (CHAR16); StringBuffer = AllocateZeroPool (0x20); ASSERT (StringBuffer != NULL); - Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3); + UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3); + Index = StrnLenS (StringBuffer, DestMax); StrCatS (StringBuffer, DestMax, L"."); - UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2); + UnicodeValueToStringS ( + StringBuffer + Index + 1, + sizeof (CHAR16) * (DestMax - (Index + 1)), + PREFIX_ZERO, + (FreqMhz % 1000) / 10, + 2 + ); StrCatS (StringBuffer, DestMax, L" GHz"); *String = (CHAR16 *) StringBuffer; return ; @@ -434,7 +441,7 @@ ConvertMemorySizeToString ( StringBuffer = AllocateZeroPool (0x24); ASSERT (StringBuffer != NULL); - UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 10); + UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10); StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM"); *String = (CHAR16 *) StringBuffer;