tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteRequestFacade.java
Date Tue, 02 Mar 2004 00:35:46 GMT
luehe       2004/03/01 16:35:46

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteRequestFacade.java
  Log:
  Clone arrays returned by getParameterValues() and getCookies()
  
  Revision  Changes    Path
  1.5       +22 -6     jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequestFacade.java
  
  Index: CoyoteRequestFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteRequestFacade.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CoyoteRequestFacade.java	27 Feb 2004 14:58:53 -0000	1.4
  +++ CoyoteRequestFacade.java	2 Mar 2004 00:35:46 -0000	1.5
  @@ -278,12 +278,20 @@
   
   
       public String[] getParameterValues(String name) {
  +        String[] ret = null;
  +
           if (System.getSecurityManager() != null){
  -            return (String[]) AccessController.doPrivileged(
  +            ret = (String[]) AccessController.doPrivileged(
                   new GetParameterValuePrivilegedAction(name));
           } else {
  -            return request.getParameterValues(name);
  +            ret = request.getParameterValues(name);
           }
  +
  +        if (ret != null) {
  +            ret = (String[]) ret.clone();
  +	}
  +
  +        return ret;
       }
   
   
  @@ -389,12 +397,20 @@
   
   
       public Cookie[] getCookies() {
  +        Cookie[] ret = null;
  +
           if (System.getSecurityManager() != null){
  -            return (Cookie[])AccessController.doPrivileged(
  +            ret = (Cookie[])AccessController.doPrivileged(
                   new GetCookiesPrivilegedAction());
           } else {
  -            return request.getCookies();
  -        }        
  +            ret = request.getCookies();
  +        }
  +
  +        if (ret != null) {
  +            ret = (Cookie[]) ret.clone();
  +        }
  +
  +        return ret;  
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message