From: Thomas Wolf Date: Wed, 14 Apr 2021 15:47:38 +0000 (+0200) Subject: ssh: ensure list is modifiable before using Iterator.remove(). X-Git-Tag: v5.12.0.202105051250-m2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F179313%2F1;p=jgit.git ssh: ensure list is modifiable before using Iterator.remove(). Bug: 572849 Change-Id: If6be0024d2069e2d85541d7e87c6b0371db4b3df Signed-off-by: Thomas Wolf --- diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitKexExtensionHandler.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitKexExtensionHandler.java index 489c77d736..9446aaa7d6 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitKexExtensionHandler.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitKexExtensionHandler.java @@ -129,8 +129,8 @@ public class JGitKexExtensionHandler extends AbstractLoggingBean // such that supported ones are at the front, in client order, // followed by unsupported ones, also in client order. if (serverAlgorithms != null && !serverAlgorithms.isEmpty()) { - List> clientAlgorithms = session - .getSignatureFactories(); + List> clientAlgorithms = new ArrayList<>( + session.getSignatureFactories()); if (log.isDebugEnabled()) { log.debug( "handleServerSignatureAlgorithms({}): PubkeyAcceptedAlgorithms before: {}", //$NON-NLS-1$