mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-635: Heap pollution is not possible within SimpleDirectory(ObjectType... objects).
From https://docs.oracle.com/javase/tutorial/java/generics/nonReifiableVarargsType.html#vulnerabilities: "Heap pollution occurs when a variable of a parameterized type refers to an object that is not of that parameterized type." In this case, the parameterized type (ObjectType) and the array of that type within this constructor are always used as their formal types.
This commit is contained in:
@@ -85,6 +85,7 @@ public class SimpleDirectory<ObjectType extends Identifiable>
|
||||
* @param objects
|
||||
* The objects that should be present in this directory.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public SimpleDirectory(ObjectType... objects) {
|
||||
this(Arrays.asList(objects));
|
||||
}
|
||||
|
Reference in New Issue
Block a user