| Index: chrome/renderer/autofill/form_autofill_util.cc
|
| diff --git a/chrome/renderer/autofill/form_autofill_util.cc b/chrome/renderer/autofill/form_autofill_util.cc
|
| index 95684fd9827844d38cc4dd7206d74c9eb918ceb1..105c89dec33683700874f1617ebe65f87acd9fd7 100644
|
| --- a/chrome/renderer/autofill/form_autofill_util.cc
|
| +++ b/chrome/renderer/autofill/form_autofill_util.cc
|
| @@ -535,6 +535,8 @@ void PreviewFormField(WebKit::WebFormControlElement* field,
|
|
|
| namespace autofill {
|
|
|
| +const size_t kMaxParseableFields = 100;
|
| +
|
| // In HTML5, all text fields except password are text input fields to
|
| // autocomplete.
|
| bool IsTextInput(const WebInputElement* element) {
|
| @@ -717,8 +719,9 @@ bool WebFormElementToFormData(
|
| fields_extracted[i] = true;
|
| }
|
|
|
| - // If we failed to extract any fields, give up.
|
| - if (form_fields.empty())
|
| + // If we failed to extract any fields, give up. Also, to avoid overly
|
| + // expensive computation, we impose a maximum number of allowable fields.
|
| + if (form_fields.empty() || form_fields.size() > kMaxParseableFields)
|
| return false;
|
|
|
| // Loop through the label elements inside the form element. For each label
|
|
|