From dba275689353e49617f60ebe85618f17e1774bfb Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Wed, 5 Aug 2015 02:55:05 +0000 Subject: IntelFrameworkPkg FrameworkUefiLib: Fix wrong DestMax passed to StrCpyS() The second parameter 'DestMax' of StrCpyS() should be the number of unicode characters, not the size in bytes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18159 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IntelFrameworkPkg') diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c index 2570ff4db9..f0dcf9fb25 100644 --- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c +++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c @@ -763,7 +763,7 @@ CatVSPrint ( } if (String != NULL) { - StrCpyS(BufferToReturn, SizeRequired, String); + StrCpyS(BufferToReturn, SizeRequired / sizeof(CHAR16), String); } UnicodeVSPrint(BufferToReturn + StrLen(BufferToReturn), (CharactersRequired+1) * sizeof(CHAR16), FormatString, Marker); -- cgit v1.2.3