Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc

Issue 10833017: Fix gcc 4.7 building problems - cont 2. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Modified per Adam's comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc
diff --git a/webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc b/webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc
index 860c6b3ef482b079c1940b13c4da61427b70e059..8bf2616ad482710ab2ed106514979ca57ef3ef3a 100644
--- a/webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc
+++ b/webkit/plugins/npapi/test/plugin_execute_stream_javascript.cc
@@ -38,8 +38,14 @@ int32 ExecuteStreamJavaScript::Write(NPStream *stream, int32 offset, int32 len,
std::string javascript("javascript:");
javascript.append(static_cast<char*>(buffer), len);
+ size_t js_length = javascript.length();
+ if (js_length != static_cast<uint32_t>(js_length)) {
+ SetError("Javascript too long.");
+ return -1;
+ }
- NPString script_string = { javascript.c_str(), javascript.length() };
+ NPString script_string = { javascript.c_str(),
+ static_cast<uint32_t>(js_length) };
NPObject *window_obj = NULL;
NPAPIClient::PluginClient::HostFunctions()->getvalue(
id(), NPNVWindowNPObject, &window_obj);
« no previous file with comments | « sandbox/linux/suid/client/setuid_sandbox_client.cc ('k') | webkit/plugins/npapi/test/plugin_windowless_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698