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

Unified Diff: chrome_elf/blacklist/blacklist.cc

Issue 346763003: Adding blacklisted dlls to safe browsing incident reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@updatedWard2
Patch Set: nits Created 6 years, 6 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 | « chrome_elf/blacklist/blacklist.h ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/blacklist/blacklist.cc
diff --git a/chrome_elf/blacklist/blacklist.cc b/chrome_elf/blacklist/blacklist.cc
index d0770d47a32da7d35e20469902d489ad2f19e45f..ef0d14e21afcb4a41ecb02dd5f990d0b78dc9a4f 100644
--- a/chrome_elf/blacklist/blacklist.cc
+++ b/chrome_elf/blacklist/blacklist.cc
@@ -382,7 +382,7 @@ bool Initialize(bool force) {
return NT_SUCCESS(ret) && page_executable;
}
-bool AddDllsFromRegistryToBlacklist() {
+void AddDllsFromRegistryToBlacklist() {
HKEY key = NULL;
LONG result = ::RegOpenKeyEx(HKEY_CURRENT_USER,
kRegistryFinchListPath,
@@ -391,9 +391,9 @@ bool AddDllsFromRegistryToBlacklist() {
&key);
if (result != ERROR_SUCCESS)
- return false;
+ return;
- // We add dlls from the registry to the blacklist, and then clear registry.
+ // We add dlls from the registry to the blacklist.
DWORD value_len;
DWORD name_len = MAX_PATH;
std::vector<wchar_t> name_buffer(name_len);
@@ -402,24 +402,22 @@ bool AddDllsFromRegistryToBlacklist() {
value_len = 0;
result = ::RegEnumValue(
key, i, &name_buffer[0], &name_len, NULL, NULL, NULL, &value_len);
+ if (result != ERROR_SUCCESS)
+ break;
name_len = name_len + 1;
csharp 2014/06/23 17:14:34 Nit: add a blank line above
krstnmnlsn 2014/06/27 15:33:27 Done.
value_len = value_len + 1;
std::vector<wchar_t> value_buffer(value_len);
result = ::RegEnumValue(key, i, &name_buffer[0], &name_len, NULL, NULL,
reinterpret_cast<BYTE*>(&value_buffer[0]),
&value_len);
+ if (result != ERROR_SUCCESS)
+ break;
value_buffer[value_len - 1] = L'\0';
-
- if (result == ERROR_SUCCESS) {
- AddDllToBlacklist(&value_buffer[0]);
- }
+ AddDllToBlacklist(&value_buffer[0]);
}
- // Delete the finch registry key to clear the values.
- result = ::RegDeleteKey(key, L"");
-
::RegCloseKey(key);
- return result == ERROR_SUCCESS;
+ return;
}
} // namespace blacklist
« no previous file with comments | « chrome_elf/blacklist/blacklist.h ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698