summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/user_script_slave.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-04 00:08:47 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-04 00:08:47 +0000
commitb5610509b9743199b430fcb6481e26a80e1eb6c9 (patch)
tree16f77a49aa10da71808411fe51b1e97fc1c166f4 /chrome/renderer/user_script_slave.cc
parent2c0a3347e89dab58e3528c3a2bca61db4ef32d6c (diff)
downloadchromium_src-b5610509b9743199b430fcb6481e26a80e1eb6c9.zip
chromium_src-b5610509b9743199b430fcb6481e26a80e1eb6c9.tar.gz
chromium_src-b5610509b9743199b430fcb6481e26a80e1eb6c9.tar.bz2
Fix null termination bug when reading UserScript
data from shared memory in UserScriptSlave. Review URL: http://codereview.chromium.org/60111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r--chrome/renderer/user_script_slave.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 9b424f0..aedc345 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -90,13 +90,15 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
const char* body = NULL;
int body_length = 0;
CHECK(pickle.ReadData(&iter, &body, &body_length));
- script->js_scripts()[j].set_external_content(body);
+ script->js_scripts()[j].set_external_content(
+ StringPiece(body, body_length));
}
for (size_t j = 0; j < script->css_scripts().size(); ++j) {
const char* body = NULL;
int body_length = 0;
CHECK(pickle.ReadData(&iter, &body, &body_length));
- script->css_scripts()[j].set_external_content(body);
+ script->css_scripts()[j].set_external_content(
+ StringPiece(body, body_length));
}
}