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

Unified Diff: components/autofill/core/browser/validation.cc

Issue 1907163003: Don't offer to save credit cards with an empty or 0 month. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | components/autofill/core/browser/validation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/validation.cc
diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc
index debe05340d4283bfa62f191bc8733066e249e091..22a3c91fca1b0ef16eeb2e847a57b9e1182948ea 100644
--- a/components/autofill/core/browser/validation.cc
+++ b/components/autofill/core/browser/validation.cc
@@ -40,6 +40,9 @@ bool IsValidCreditCardExpirationDate(const base::string16& year,
bool IsValidCreditCardExpirationDate(int year,
int month,
const base::Time& now) {
+ if (month < 1 || month > 12)
+ return false;
+
base::Time::Exploded now_exploded;
now.LocalExplode(&now_exploded);
« no previous file with comments | « no previous file | components/autofill/core/browser/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698