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

Unified Diff: native_client_sdk/src/libraries/nacl_io/fusefs/fuse_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/fusefs/fuse_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
index 100fb113b6bfecaef3b2b0dca3f2d59d55b64dfa..226c064d5004ac4df46ef5c58c06bb9f4c9a9948 100644
--- a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
@@ -143,7 +143,8 @@ Error FuseFs::Unlink(const Path& path) {
return ENOSYS;
}
- int result = fuse_ops_->unlink(path.Join().c_str());
+ std::string path_str = path.Join();
+ int result = fuse_ops_->unlink(path_str.c_str());
if (result < 0)
return -result;
@@ -156,7 +157,8 @@ Error FuseFs::Mkdir(const Path& path, int perm) {
return ENOSYS;
}
- int result = fuse_ops_->mkdir(path.Join().c_str(), perm);
+ std::string path_str = path.Join();
+ int result = fuse_ops_->mkdir(path_str.c_str(), perm);
if (result < 0)
return -result;
@@ -169,7 +171,8 @@ Error FuseFs::Rmdir(const Path& path) {
return ENOSYS;
}
- int result = fuse_ops_->rmdir(path.Join().c_str());
+ std::string path_str = path.Join();
+ int result = fuse_ops_->rmdir(path_str.c_str());
if (result < 0)
return -result;
@@ -202,7 +205,9 @@ Error FuseFs::Rename(const Path& path, const Path& newpath) {
return ENOSYS;
}
- int result = fuse_ops_->rename(path.Join().c_str(), newpath.Join().c_str());
+ std::string path_str = path.Join();
+ std::string newpath_str = newpath.Join();
+ int result = fuse_ops_->rename(path_str.c_str(), newpath_str.c_str());
if (result < 0)
return -result;

Powered by Google App Engine
This is Rietveld 408576698