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

Unified Diff: native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc

Issue 1062463004: [NaCl SDK] nacl_io: Fix use-after-free bug in html5fs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use const std::string& Created 5 years, 8 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
« no previous file with comments | « native_client_sdk/src/examples/demo/nacl_io_demo/example.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc
index bb6b9cc87ed4f451f860377ab4d25aa1816555b6..b71de276270e2668d5cc3cd4b54ea75302298010 100644
--- a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc
@@ -45,9 +45,8 @@ ino_t Html5Fs::HashPath(const Path& path) {
// Apply a running DJB2a to each part of the path
for (size_t segment = 0; segment < path.Size(); segment++) {
- const char *ptr = path.Part(segment).c_str();
- size_t len = path.Part(segment).length();
- hash = HashPathSegment(hash, ptr, len);
+ const std::string& part = path.Part(segment);
+ hash = HashPathSegment(hash, part.c_str(), part.length());
}
return hash;
}
« no previous file with comments | « native_client_sdk/src/examples/demo/nacl_io_demo/example.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698