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

Unified Diff: extensions/common/url_pattern_unittest.cc

Issue 441643009: Merge 285492 "Don't allow null bytes in hosts of host permissions." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 4 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 | « extensions/common/url_pattern.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/url_pattern_unittest.cc
===================================================================
--- extensions/common/url_pattern_unittest.cc (revision 287395)
+++ extensions/common/url_pattern_unittest.cc (working copy)
@@ -44,6 +44,15 @@
pattern.Parse(kInvalidPatterns[i].pattern))
<< kInvalidPatterns[i].pattern;
}
+
+ {
+ // Cannot use a C string, because this contains a null byte.
+ std::string null_host("http://\0www/", 12);
+ URLPattern pattern(URLPattern::SCHEME_ALL);
+ EXPECT_EQ(URLPattern::PARSE_ERROR_INVALID_HOST,
+ pattern.Parse(null_host))
+ << null_host;
+ }
};
TEST(ExtensionURLPatternTest, Ports) {
« no previous file with comments | « extensions/common/url_pattern.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698