Index: sandbox/win/src/named_pipe_dispatcher.cc |
diff --git a/sandbox/win/src/named_pipe_dispatcher.cc b/sandbox/win/src/named_pipe_dispatcher.cc |
index 6bf982a9424e8b15657ba26ff12f35dc03ec4880..53bb7c4c658d0d81d3f9222271eac1b69e8061ae 100644 |
--- a/sandbox/win/src/named_pipe_dispatcher.cc |
+++ b/sandbox/win/src/named_pipe_dispatcher.cc |
@@ -56,16 +56,15 @@ bool NamedPipeDispatcher::CreateNamedPipe(IPCInfo* ipc, |
ipc->return_info.win32_result = ERROR_ACCESS_DENIED; |
ipc->return_info.handle = INVALID_HANDLE_VALUE; |
- std::vector<base::string16> paths; |
- std::vector<base::string16> innerpaths; |
- base::SplitString(*name, '/', &paths); |
- |
- for (std::vector<base::string16>::const_iterator iter = paths.begin(); |
- iter != paths.end(); ++iter) { |
- base::SplitString(*iter, '\\', &innerpaths); |
- for (std::vector<base::string16>::const_iterator iter2 = innerpaths.begin(); |
- iter2 != innerpaths.end(); ++iter2) { |
- if (*iter2 == L"..") |
+ base::StringPiece16 dotdot(L".."); |
+ |
+ for (const base::StringPiece16& path : base::SplitStringPiece( |
+ *name, base::string16(1, '/'), |
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
+ for (const base::StringPiece16& inner : base::SplitStringPiece( |
+ path, base::string16(1, '\\'), |
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
+ if (inner == dotdot) |
return true; |
} |
} |