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

Unified Diff: net/tools/transport_security_state_generator/input_file_parsers.cc

Issue 2906223002: Check that all preloaded hostnames are in canonicalized form. (Closed)
Patch Set: Created 3 years, 7 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: net/tools/transport_security_state_generator/input_file_parsers.cc
diff --git a/net/tools/transport_security_state_generator/input_file_parsers.cc b/net/tools/transport_security_state_generator/input_file_parsers.cc
index 4a633080ed00ec5a830196241985c253babdc411..2a8d3d80490e566eafba195056a7d862cd4029e8 100644
--- a/net/tools/transport_security_state_generator/input_file_parsers.cc
+++ b/net/tools/transport_security_state_generator/input_file_parsers.cc
@@ -303,6 +303,12 @@ bool ParseJSON(base::StringPiece json,
return false;
}
+ if (entry->hostname.empty()) {
+ LOG(ERROR) << "The hostname for entry " << base::SizeTToString(i)
+ << " is empty";
+ return false;
+ }
+
parsed->GetBoolean("include_subdomains", &entry->include_subdomains);
std::string mode;
parsed->GetString("mode", &mode);

Powered by Google App Engine
This is Rietveld 408576698