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

Unified Diff: printing/page_range_unittest.cc

Issue 25651002: Fixed memory overflow caused by invalid input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « printing/page_range.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/page_range_unittest.cc
diff --git a/printing/page_range_unittest.cc b/printing/page_range_unittest.cc
index 7b0f5779fc249a33c3d93a3e990dd0d3c21f4b16..5370e97185582d042bb6514bf5dc5590954c3a7b 100644
--- a/printing/page_range_unittest.cc
+++ b/printing/page_range_unittest.cc
@@ -32,5 +32,15 @@ TEST(PageRangeTest, RangeMerge) {
TEST(PageRangeTest, Empty) {
printing::PageRanges ranges;
std::vector<int> pages(printing::PageRange::GetPages(ranges));
- EXPECT_EQ(0U, pages.size());
+ EXPECT_TRUE(pages.empty());
+}
+
+TEST(PageRangeTest, Huge) {
+ printing::PageRanges ranges;
+ printing::PageRange range;
+ range.from = 1;
+ range.to = 2000000000;
+ ranges.push_back(range);
+ std::vector<int> pages(printing::PageRange::GetPages(ranges));
+ EXPECT_FALSE(pages.empty());
}
« no previous file with comments | « printing/page_range.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698