diff options
author | wfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-14 21:24:24 +0000 |
---|---|---|
committer | wfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-14 21:24:24 +0000 |
commit | b43734a17cbd7b23bfda66d834f801c759135c1e (patch) | |
tree | 1eb15f4fe67c44431ce4eaaeb754290102ef655e /ppapi | |
parent | a941d4e57a9c663e2c9feb3779fef16f8f3f7457 (diff) | |
download | chromium_src-b43734a17cbd7b23bfda66d834f801c759135c1e.zip chromium_src-b43734a17cbd7b23bfda66d834f801c759135c1e.tar.gz chromium_src-b43734a17cbd7b23bfda66d834f801c759135c1e.tar.bz2 |
Array index [0] on zero length array is undefined on C++03
and will assert when _ITERATOR_DEBUG_LEVEL is set to >= 1 on VS2010
Add protection against this code.
This is the same underlying issue as 132037 so tagging to that bug
BUG=132037
TEST=browser_tests --gtest_filter=OutOfProcessPPAPITest.*
Review URL: https://codereview.chromium.org/26005003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/tests/test_char_set.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ppapi/tests/test_char_set.cc b/ppapi/tests/test_char_set.cc index de998d0..f7ff910 100644 --- a/ppapi/tests/test_char_set.cc +++ b/ppapi/tests/test_char_set.cc @@ -113,7 +113,8 @@ std::string TestCharSet::TestUTF16ToCharSet() { std::vector<uint16_t> utf16; utf16.push_back(0); std::string output_buffer; - uint32_t utf8result_len = static_cast<uint32_t>(output_buffer.size()); + output_buffer.resize(1); + uint32_t utf8result_len = 0; PP_Bool result = char_set_trusted_interface_->UTF16ToCharSet( &utf16[0], 0, "latin1", PP_CHARSET_TRUSTED_CONVERSIONERROR_SUBSTITUTE, &output_buffer[0], &utf8result_len); |