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

Unified Diff: chrome/browser/ui/views/certificate_selector.cc

Issue 2277133003: Fixed a crash in Chrome caused by duplicate certificates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/certificate_selector.cc
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc
index f6cb4f7443b5f3bc19a98e229ecbb41e7786803f..db12ea3290558c0eec341b34b414fec8cb6b0272 100644
--- a/chrome/browser/ui/views/certificate_selector.cc
+++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -178,6 +178,18 @@ bool CertificateSelector::CanShow(content::WebContents* web_contents) {
void CertificateSelector::Show() {
constrained_window::ShowWebModalDialogViews(this, web_contents_);
+ // TODO(isandrk): A certificate that was previously provided by *both* the
+ // platform and an extension will get incorrectly filtered out if the
+ // extension stops providing it (both instances will be filtered out), hence
+ // the |certificates_| array will be empty. Displaying a dialog with an empty
+ // list won't make much sense for the user, and also there are some CHECKs in
+ // the code that will fail when the list is empty and that's why an early exit
+ // is performed here. See crbug.com/641440 for more details.
+ if (certificates_.empty()) {
+ GetWidget()->Close();
+ return;
+ }
+
// Select the first row automatically. This must be done after the dialog has
// been created.
table_->Select(0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698