Author: mes
Date: 2012-04-13 15:02:00 -0700 (Fri, 13 Apr 2012)
New Revision: 28834

Modified:
   
core3/api/trunk/equations-api/src/main/java/org/cytoscape/equations/Equation.java
Log:
Fixed potential security vulnerability.

Modified: 
core3/api/trunk/equations-api/src/main/java/org/cytoscape/equations/Equation.java
===================================================================
--- 
core3/api/trunk/equations-api/src/main/java/org/cytoscape/equations/Equation.java
   2012-04-13 21:54:42 UTC (rev 28833)
+++ 
core3/api/trunk/equations-api/src/main/java/org/cytoscape/equations/Equation.java
   2012-04-13 22:02:00 UTC (rev 28834)
@@ -30,7 +30,7 @@
 package org.cytoscape.equations;
 
 
-import java.util.HashMap;
+import java.util.Arrays;
 import java.util.Map;
 import java.util.Set;
 
@@ -44,7 +44,7 @@
        private final Map<String, Object> defaultVariableValues;
        private final Object[] code;
        private final int[] sourceLocations;
-       private final Class type;
+       private final Class<?> type;
 
        /**
         *  Constructs an <code>Equation</code>.
@@ -58,13 +58,13 @@
         */
        public Equation(final String equation, final Set<String> 
variableReferences,
                        final Map<String, Object> defaultVariableValues, final 
Object[] code,
-                       final int[] sourceLocations, final Class type)
+                       final int[] sourceLocations, final Class<?> type)
        {
                this.equation              = equation;
                this.variableReferences    = variableReferences;
                this.defaultVariableValues = defaultVariableValues;
-               this.code                  = code;
-               this.sourceLocations       = sourceLocations;
+               this.code                  = Arrays.copyOf(code, code.length);
+               this.sourceLocations       = Arrays.copyOf(sourceLocations, 
sourceLocations.length);
                this.type                  = type;
        }
 
@@ -112,5 +112,5 @@
        /** The overall type of the Equation, e.g. Long.class, String.class etc.
         *  @return the type of this 
         */
-       public Class getType() { return type; }
+       public Class<?> getType() { return type; }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to