You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/09/29 20:51:31 UTC

[2/4] guacamole-client git commit: GUACAMOLE-635: Heap pollution is not possible within SimpleDirectory(ObjectType... objects).

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.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/182f204c
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/182f204c
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/182f204c

Branch: refs/heads/master
Commit: 182f204c958ab0c188197e403f75e8550bcb8279
Parents: 1fef6a0
Author: Michael Jumper <mj...@apache.org>
Authored: Sat Sep 29 13:19:21 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sat Sep 29 13:19:21 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/182f204c/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java
----------------------------------------------------------------------
diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java
index 4f64ec8..3865570 100644
--- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java
+++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleDirectory.java
@@ -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));
     }