summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 19:49:46 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 19:49:46 +0000
commit584d07127c8412b41215860f96d5399b53a5c2a8 (patch)
treeccc5c10bb0bed954e00a85fc231890e624c813ff /chrome/browser/autofill
parent50bbe6ce965edc516b4f20c71520151c4ef0bf39 (diff)
downloadchromium_src-584d07127c8412b41215860f96d5399b53a5c2a8.zip
chromium_src-584d07127c8412b41215860f96d5399b53a5c2a8.tar.gz
chromium_src-584d07127c8412b41215860f96d5399b53a5c2a8.tar.bz2
Fix a crash when parsing address fields. It's possible we've run out of fields while parsing the zip code. The other fields check this in ParseText, but ParseZipCode opens up the field to get at the name.
BUG=35176 TEST=none Review URL: http://codereview.chromium.org/604002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/address_field.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc
index a40ad87..69f9085 100644
--- a/chrome/browser/autofill/address_field.cc
+++ b/chrome/browser/autofill/address_field.cc
@@ -248,6 +248,10 @@ bool AddressField::ParseZipCode(
if (address_field->zip_)
return false;
+ // We may be out of fields.
+ if (!**iter)
+ return false;
+
string16 pattern;
if (is_ecml) {
pattern = GetEcmlPattern(kEcmlShipToPostalCode,