From 8daab317ff959905e926b861a7d2aa876fd10429 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Mon, 14 Jul 2014 12:13:53 -0700 Subject: Fix an out-of-boundary issue for wide string BUG=381521 R=palmer@chromium.org Review URL: https://codereview.chromium.org/383563002 --- core/include/fxcrt/fx_string.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/include') diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index fe56e1867e..26b04b70fa 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -634,9 +634,11 @@ public: static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1); - static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1); + static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len); - static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1); + static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len); + + static FX_STRSIZE WStringLength(const unsigned short* str); operator FX_LPCWSTR() const { -- cgit v1.2.3