summaryrefslogtreecommitdiff
path: root/src/inc/fstring.h
diff options
context:
space:
mode:
authorJohn Chen <jochen@microsoft.com>2016-10-10 09:39:08 -0700
committerGitHub <noreply@github.com>2016-10-10 09:39:08 -0700
commite197c9e3bdc5f047689f69878fcc9ff72c438482 (patch)
treed048194e8c12a5a6204bd2f269655cc481380eea /src/inc/fstring.h
parentedc6bf9d65e84afb6425cd23ee12ca18c5029398 (diff)
downloadcoreclr-e197c9e3bdc5f047689f69878fcc9ff72c438482.tar.gz
coreclr-e197c9e3bdc5f047689f69878fcc9ff72c438482.tar.bz2
coreclr-e197c9e3bdc5f047689f69878fcc9ff72c438482.zip
Fix buffer length usage in UTF-8 to Unicode conversion (#7540)
These changes are ported from desktop CLR.
Diffstat (limited to 'src/inc/fstring.h')
-rw-r--r--src/inc/fstring.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inc/fstring.h b/src/inc/fstring.h
index 68c9098c8f..9245885896 100644
--- a/src/inc/fstring.h
+++ b/src/inc/fstring.h
@@ -21,6 +21,9 @@
namespace FString
{
+ // Note: All "length" parameters do not count the space for the null terminator.
+ // Caller of Unicode_Utf8 and Utf8_Unicode must pass in a buffer of size at least length + 1.
+
// Scan for ASCII only string, calculate result UTF8 string length
HRESULT Unicode_Utf8_Length(__in_z LPCWSTR pString, __out bool * pAllAscii, __out DWORD * pLength);