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

Unified Diff: net/cert/internal/verify_name_match_unittest.cc

Issue 1160643002: Remove dangerous std::string constructor for der::Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null-terminated strings bug, and use a static factory method instead of another constructor Created 5 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
« no previous file with comments | « no previous file | net/der/input.h » ('j') | net/der/input.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/verify_name_match_unittest.cc
diff --git a/net/cert/internal/verify_name_match_unittest.cc b/net/cert/internal/verify_name_match_unittest.cc
index 0bdce8a028ac56ee7b8dd92e0d91257a57273100..1753d8f9f6f35127ddfaecc13522a6e621c535f5 100644
--- a/net/cert/internal/verify_name_match_unittest.cc
+++ b/net/cert/internal/verify_name_match_unittest.cc
@@ -11,10 +11,14 @@ namespace net {
TEST(VerifyNameMatchTest, Simple) {
// TODO(mattm): Use valid Names.
- EXPECT_TRUE(VerifyNameMatch(der::Input("hello"), der::Input("hello")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("aello"), der::Input("hello")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("hello"), der::Input("hello1")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("hello1"), der::Input("hello")));
+ EXPECT_TRUE(VerifyNameMatch(der::Input::FromCString("hello"),
+ der::Input::FromCString("hello")));
+ EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("aello"),
+ der::Input::FromCString("hello")));
+ EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("hello"),
+ der::Input::FromCString("hello1")));
+ EXPECT_FALSE(VerifyNameMatch(der::Input::FromCString("hello1"),
+ der::Input::FromCString("hello")));
}
} // namespace net
« no previous file with comments | « no previous file | net/der/input.h » ('j') | net/der/input.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698