Commit defea14c authored by rmcilroy@chromium.org's avatar rmcilroy@chromium.org

Fix external snapshot reading by removing an assumption that strings in the...

Fix external snapshot reading by removing an assumption that strings in the snapshot file are null-terminated.

R=vogelheim@chromium.org

Review URL: https://codereview.chromium.org/496253003

Patch from André Baixo <baixo@google.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23416 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b250a990
......@@ -34,7 +34,9 @@ class NativesStore {
int GetIndex(const char* name) {
for (int i = 0; i < native_names_.length(); ++i) {
if (strcmp(name, native_names_[i].start()) == 0) {
int native_name_length = native_names_[i].length();
if ((static_cast<int>(strlen(name)) == native_name_length) &&
(strncmp(name, native_names_[i].start(), native_name_length) == 0)) {
return i;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment