summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorwfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-14 21:24:24 +0000
committerwfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-14 21:24:24 +0000
commitb43734a17cbd7b23bfda66d834f801c759135c1e (patch)
tree1eb15f4fe67c44431ce4eaaeb754290102ef655e /ppapi
parenta941d4e57a9c663e2c9feb3779fef16f8f3f7457 (diff)
downloadchromium_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.cc3
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);