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

Unified Diff: components/autofill/content/browser/request_autocomplete_manager.cc

Issue 98753005: [Autofill] Sanitize all data that comes in over IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: components/autofill/content/browser/request_autocomplete_manager.cc
diff --git a/components/autofill/content/browser/request_autocomplete_manager.cc b/components/autofill/content/browser/request_autocomplete_manager.cc
index f48610f91d77fe1a8e835c7261a2e2ade608fa9c..80d0fa43aa875f8fd4d26122d46ef6f50645c171 100644
--- a/components/autofill/content/browser/request_autocomplete_manager.cc
+++ b/components/autofill/content/browser/request_autocomplete_manager.cc
@@ -7,6 +7,7 @@
#include "components/autofill/content/browser/autofill_driver_impl.h"
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/browser/form_structure.h"
+#include "components/autofill/core/common/autofill_data_sanitizer.h"
#include "components/autofill/core/common/form_data.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -26,6 +27,10 @@ RequestAutocompleteManager::~RequestAutocompleteManager() {}
void RequestAutocompleteManager::OnRequestAutocomplete(
const FormData& form,
const GURL& frame_url) {
+ // Bail if the arguments appear to be corrupt.
+ if (!IsSanitizedFormData(form))
+ return;
+
if (!autofill_driver_->autofill_manager()->IsAutofillEnabled()) {
ReturnAutocompleteResult(
blink::WebFormElement::AutocompleteResultErrorDisabled,

Powered by Google App Engine
This is Rietveld 408576698