Index: sandbox/win/src/handle_closer.cc |
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc |
index 30e8977fa85d52f5b83dfcd2070900108d68c910..4111623038f8310e8fe89e6fb2cfbfcd0ee1df35 100644 |
--- a/sandbox/win/src/handle_closer.cc |
+++ b/sandbox/win/src/handle_closer.cc |
@@ -39,17 +39,25 @@ ResultCode HandleCloser::AddHandle(const base::char16* handle_type, |
if (!handle_type) |
return SBOX_ERROR_BAD_PARAMS; |
+ base::string16 resolved_name; |
+ if (handle_name) { |
+ resolved_name = handle_name; |
+ if (handle_type == base::string16(L"Key")) |
cpu_(ooo_6.6-7.5)
2014/08/13 23:18:35
can you use == L"key"; so avoids constructing a st
|
+ if (!ResolveRegistryName(resolved_name, &resolved_name)) |
+ return SBOX_ERROR_BAD_PARAMS; |
+ } |
+ |
HandleMap::iterator names = handles_to_close_.find(handle_type); |
if (names == handles_to_close_.end()) { // We have no entries for this type. |
std::pair<HandleMap::iterator, bool> result = handles_to_close_.insert( |
HandleMap::value_type(handle_type, HandleMap::mapped_type())); |
names = result.first; |
if (handle_name) |
- names->second.insert(handle_name); |
+ names->second.insert(resolved_name); |
} else if (!handle_name) { // Now we need to close all handles of this type. |
names->second.clear(); |
} else if (!names->second.empty()) { // Add another name for this type. |
- names->second.insert(handle_name); |
+ names->second.insert(resolved_name); |
} // If we're already closing all handles of type then we're done. |
return SBOX_ALL_OK; |