]> source.dussan.org Git - jgit.git/commitdiff
ssh: ensure list is modifiable before using Iterator.remove(). 13/179313/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Wed, 14 Apr 2021 15:47:38 +0000 (17:47 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Wed, 14 Apr 2021 15:48:34 +0000 (17:48 +0200)
Bug: 572849
Change-Id: If6be0024d2069e2d85541d7e87c6b0371db4b3df
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitKexExtensionHandler.java

index 489c77d7367b00b05ae40adf1db6cb6efd216da2..9446aaa7d6648f4fea054d0c7ac764d418d29cc8 100644 (file)
@@ -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<NamedFactory<Signature>> clientAlgorithms = session
-                                       .getSignatureFactories();
+                       List<NamedFactory<Signature>> clientAlgorithms = new ArrayList<>(
+                                       session.getSignatureFactories());
                        if (log.isDebugEnabled()) {
                                log.debug(
                                                "handleServerSignatureAlgorithms({}): PubkeyAcceptedAlgorithms before: {}", //$NON-NLS-1$