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

Unified Diff: native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_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: 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
Index: native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_fs.cc b/native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_fs.cc
index abee3894e866fab547d9b777c29ce0bbe3b8280e..cf94fee55903bf5f57eb5599787049621c42d7bc 100644
--- a/native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/passthroughfs/passthrough_fs.cc
@@ -26,7 +26,8 @@ Error PassthroughFs::OpenWithMode(const Path& path, int open_flags,
mode_t mode, ScopedNode* out_node) {
out_node->reset(NULL);
int real_fd;
- int error = _real_open(path.Join().c_str(), open_flags, mode, &real_fd);
+ std::string path_str = path.Join();
+ int error = _real_open(path_str.c_str(), open_flags, mode, &real_fd);
if (error)
return error;
@@ -37,7 +38,8 @@ Error PassthroughFs::OpenWithMode(const Path& path, int open_flags,
Error PassthroughFs::OpenResource(const Path& path, ScopedNode* out_node) {
int real_fd;
out_node->reset(NULL);
- int error = _real_open_resource(path.Join().c_str(), &real_fd);
+ std::string path_str = path.Join();
+ int error = _real_open_resource(path_str.c_str(), &real_fd);
if (error)
return error;
@@ -51,11 +53,13 @@ Error PassthroughFs::Unlink(const Path& path) {
}
Error PassthroughFs::Mkdir(const Path& path, int perm) {
- return _real_mkdir(path.Join().c_str(), perm);
+ std::string path_str = path.Join();
+ return _real_mkdir(path_str.c_str(), perm);
}
Error PassthroughFs::Rmdir(const Path& path) {
- return _real_rmdir(path.Join().c_str());
+ std::string path_str = path.Join();
+ return _real_rmdir(path_str.c_str());
}
Error PassthroughFs::Remove(const Path& path) {

Powered by Google App Engine
This is Rietveld 408576698