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

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..bd9e5d5241aa325e37eb790b5325e333f3b62705 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
msw 2016/08/29 17:08:29 What exactly is the TODO here? Will you try to fix
Ivan Šandrk 2016/08/30 14:23:22 So this is just a quick fix for the crash, the act
+ // 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
msw 2016/08/29 17:08:29 nit: |certificates_|
Ivan Šandrk 2016/08/30 14:23:22 Done.
+ // 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.
msw 2016/08/29 17:08:29 nit: fix indent.
Ivan Šandrk 2016/08/30 14:23:23 Done.
+ if (certificates_.empty()) {
+ GetWidget()->Close();
msw 2016/08/29 17:08:28 How is this dialog triggered? If the user clicks a
Ivan Šandrk 2016/08/30 14:23:22 Chrome network stack requests the dialog to be ope
+ 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