distlib/luigi/zookeeper/mybatis/solc/solana/go-ethereum: CWE-407 patches + unit tests; solana CLEAN
This commit is contained in:
parent
c9e86c450c
commit
b4e2eda927
17 changed files with 2087 additions and 1 deletions
|
|
@ -0,0 +1,25 @@
|
|||
# UNDF: UNDF-2026-000000343
|
||||
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java
|
||||
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java
|
||||
@@ -24,6 +24,7 @@
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -948,11 +949,12 @@
|
||||
- // This would be done better with a Set but ACL hashcode/equals do not
|
||||
- // allow for null values
|
||||
- final ArrayList<ACL> retval = new ArrayList<>(acls.size());
|
||||
+ // CWE-407 fix: parallel HashSet for O(1) membership test instead of O(N) ArrayList.contains
|
||||
+ final List<ACL> retval = new ArrayList<>(acls.size());
|
||||
+ final Set<ACL> seen = new HashSet<>(acls.size());
|
||||
for (final ACL acl : acls) {
|
||||
- if (!retval.contains(acl)) {
|
||||
- retval.add(acl);
|
||||
+ if (seen.add(acl)) {
|
||||
+ retval.add(acl);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# UNDF: UNDF-2026-000000724
|
||||
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/AuthenticationHelper.java
|
||||
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/AuthenticationHelper.java
|
||||
@@ -20,7 +20,9 @@
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
+import java.util.HashSet;
|
||||
import java.util.List;
|
||||
+import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.zookeeper.KeeperException;
|
||||
import org.apache.zookeeper.data.Id;
|
||||
@@ -44,7 +46,7 @@
|
||||
private boolean enforceAuthEnabled;
|
||||
- private List<String> enforceAuthSchemes = new ArrayList<>();
|
||||
+ private Set<String> enforceAuthSchemes = new HashSet<>();
|
||||
private boolean saslAuthRequired;
|
||||
|
||||
public AuthenticationHelper() {
|
||||
Loading…
Add table
Add a link
Reference in a new issue