From 0801bdcc9040aa96af4bd6c2f9372a8994cea472 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 5 Dec 2016 16:18:58 +0100 Subject: [PATCH] IDEA-164951 Remote (ssh) passwords exposure --- .../editor/textarea/TextComponentSelectionModel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentSelectionModel.java b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentSelectionModel.java index feec65f524da..a4fa28a9f466 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentSelectionModel.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentSelectionModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import com.intellij.openapi.editor.markup.TextAttributes; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.swing.*; import javax.swing.text.JTextComponent; /** @@ -160,7 +161,9 @@ public class TextComponentSelectionModel implements SelectionModel { @Override public void copySelectionToClipboard() { - EditorCopyPasteHelper.getInstance().copySelectionToClipboard(myEditor); + if (! (myTextComponent instanceof JPasswordField)) { + EditorCopyPasteHelper.getInstance().copySelectionToClipboard(myEditor); + } } @Override