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

Unified Diff: net/dns/host_resolver_proc.cc

Issue 919023003: DNSDomainFromDot: Reject empty labels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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 | « net/base/dns_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_proc.cc
diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
index f2b10c649bad49e5d083024a45e04594f91324f6..98b98125c1b1e2e71f12508681fa218dc10158d6 100644
--- a/net/dns/host_resolver_proc.cc
+++ b/net/dns/host_resolver_proc.cc
@@ -10,6 +10,7 @@
#include "base/sys_byteorder.h"
#include "net/base/address_list.h"
#include "net/base/dns_reloader.h"
+#include "net/base/dns_util.h"
#include "net/base/net_errors.h"
#include "net/base/sys_addrinfo.h"
@@ -124,6 +125,13 @@ int SystemHostResolverCall(const std::string& host,
HostResolverFlags host_resolver_flags,
AddressList* addrlist,
int* os_error) {
+ // Make sure |host| is properly formed.
+ {
+ std::string out_ignored;
+ if (!DNSDomainFromDot(host, &out_ignored))
+ return ERR_NAME_NOT_RESOLVED;
+ }
Ryan Sleevi 2015/03/06 22:11:36 Don't use { } here.
+
if (os_error)
*os_error = 0;
« no previous file with comments | « net/base/dns_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698