summaryrefslogtreecommitdiffstats
path: root/net/base/transport_security_state_unittest.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 16:57:33 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 16:57:33 +0000
commit442845aaeb4720a9a8cc46a8230e93cad1112bfd (patch)
treeed96ac3c475e0618292f4cb50752d54297097b25 /net/base/transport_security_state_unittest.cc
parentd557b97a8ee9f66bda9216c66fff677229322876 (diff)
downloadchromium_src-442845aaeb4720a9a8cc46a8230e93cad1112bfd.zip
chromium_src-442845aaeb4720a9a8cc46a8230e93cad1112bfd.tar.gz
chromium_src-442845aaeb4720a9a8cc46a8230e93cad1112bfd.tar.bz2
net: don't NOTREACHED on long search terms.
We will pass long, single word search terms into the network stack to try and fetch them if they, even slightly, look like they could be a host name. DNSDomainForDot was triggering a NOTREACHED in this case because they weren't valid DNS names. BUG=53856 TEST=net_unittests http://codereview.chromium.org/3273006/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/transport_security_state_unittest.cc')
-rw-r--r--net/base/transport_security_state_unittest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/base/transport_security_state_unittest.cc b/net/base/transport_security_state_unittest.cc
index 9f30783..c4a173c 100644
--- a/net/base/transport_security_state_unittest.cc
+++ b/net/base/transport_security_state_unittest.cc
@@ -344,4 +344,15 @@ TEST_F(TransportSecurityStateTest, Preloaded) {
EXPECT_FALSE(state->IsEnabledForHost(&domain_state, "foo.noisebridge.net"));
}
+TEST_F(TransportSecurityStateTest, LongNames) {
+ scoped_refptr<TransportSecurityState> state(
+ new TransportSecurityState);
+ const char kLongName[] =
+ "lookupByWaveIdHashAndWaveIdIdAndWaveIdDomainAndWaveletIdIdAnd"
+ "WaveletIdDomainAndBlipBlipid";
+ TransportSecurityState::DomainState domain_state;
+ // Just checks that we don't hit a NOTREACHED.
+ EXPECT_FALSE(state->IsEnabledForHost(&domain_state, kLongName));
+}
+
} // namespace net